Author Question: What will the following C++11 code display? vector numbers {3, 5};for (int val : numbers) cout (Read 204 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?

Alcohol acts as a diuretic. Eight ounces of water is needed to metabolize just 1 ounce of alcohol.

Did you know?

If you use artificial sweeteners, such as cyclamates, your eyes may be more sensitive to light. Other factors that will make your eyes more sensitive to light include use of antibiotics, oral contraceptives, hypertension medications, diuretics, and antidiabetic medications.

Did you know?

In inpatient settings, adverse drug events account for an estimated one in three of all hospital adverse events. They affect approximately 2 million hospital stays every year, and prolong hospital stays by between one and five days.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

Nitroglycerin is used to alleviate various heart-related conditions, and it is also the chief component of dynamite (but mixed in a solid clay base to stabilize it).

For a complete list of videos, visit our video library