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

One way to reduce acid reflux is to lose two or three pounds. Most people lose weight in the belly area first when they increase exercise, meaning that heartburn can be reduced quickly by this method.

Did you know?

Intradermal injections are somewhat difficult to correctly administer because the skin layers are so thin that it is easy to accidentally punch through to the deeper subcutaneous layer.

Did you know?

The heart is located in the center of the chest, with part of it tipped slightly so that it taps against the left side of the chest.

Did you know?

The U.S. Preventive Services Task Force recommends that all women age 65 years of age or older should be screened with bone densitometry.

Did you know?

Prostaglandins were first isolated from human semen in Sweden in the 1930s. They were so named because the researcher thought that they came from the prostate gland. In fact, prostaglandins exist and are synthesized in almost every cell of the body.

For a complete list of videos, visit our video library