Author Question: What will the following code output?int *numbers = new int[5];for (int i = 0; i (Read 44 times)

ashley

  • Hero Member
  • *****
  • Posts: 584
What will the following code output?
int *numbers = new int[5];
for (int i = 0; i <= 4; i++)
    *(numbers + i) = i;
cout << numbers[2] << endl;

3
1
◦ five memory addresses
2
0



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

The tallest man ever known was Robert Wadlow, an American, who reached the height of 8 feet 11 inches. He died at age 26 years from an infection caused by the immense weight of his body (491 pounds) and the stress on his leg bones and muscles.

Did you know?

There are approximately 3 million unintended pregnancies in the United States each year.

Did you know?

In the United States, there is a birth every 8 seconds, according to the U.S. Census Bureau's Population Clock.

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?

Critical care patients are twice as likely to receive the wrong medication. Of these errors, 20% are life-threatening, and 42% require additional life-sustaining treatments.

For a complete list of videos, visit our video library