Author Question: What will the following C++11 code display? vector numbers {3, 5};for (int val : numbers) cout (Read 197 times)

kaid0807

  • Hero Member
  • *****
  • Posts: 515
What will the following C++11 code display?
vector numbers {3, 5};
for (int val : numbers)
    cout << val << endl;

3
3
3
3
3

5
5
5

3
5

◦ Nothing. This code has an error.



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question


 

Did you know?

The National Institutes of Health have supported research into acupuncture. This has shown that acupuncture significantly reduced pain associated with osteoarthritis of the knee, when used as a complement to conventional therapies.

Did you know?

More than 34,000 trademarked medication names and more than 10,000 generic medication names are in use in the United States.

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

The most destructive flu epidemic of all times in recorded history occurred in 1918, with approximately 20 million deaths worldwide.

Did you know?

There are 20 feet of blood vessels in each square inch of human skin.

For a complete list of videos, visit our video library