Author Question: What will the following code output?int *numbers = new int[5];for (int i = 0; i (Read 45 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?

Human kidneys will clean about 1 million gallons of blood in an average lifetime.

Did you know?

According to animal studies, the typical American diet is damaging to the liver and may result in allergies, low energy, digestive problems, and a lack of ability to detoxify harmful substances.

Did you know?

More than 30% of American adults, and about 12% of children utilize health care approaches that were developed outside of conventional medicine.

Did you know?

The people with the highest levels of LDL are Mexican American males and non-Hispanic black females.

Did you know?

The ratio of hydrogen atoms to oxygen in water (H2O) is 2:1.

For a complete list of videos, visit our video library