Author Question: What will the following code output?int *numbers = new int[5];for (int i = 0; i (Read 24 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 term pharmacology is derived from the Greek words pharmakon("claim, medicine, poison, or remedy") and logos ("study").

Did you know?

There are actually 60 minerals, 16 vitamins, 12 essential amino acids, and three essential fatty acids that your body needs every day.

Did you know?

Asthma-like symptoms were first recorded about 3,500 years ago in Egypt. The first manuscript specifically written about asthma was in the year 1190, describing a condition characterized by sudden breathlessness. The treatments listed in this manuscript include chicken soup, herbs, and sexual abstinence.

Did you know?

Asthma attacks and symptoms usually get started by specific triggers (such as viruses, allergies, gases, and air particles). You should talk to your doctor about these triggers and find ways to avoid or get rid of them.

Did you know?

The first oncogene was discovered in 1970 and was termed SRC (pronounced "SARK").

For a complete list of videos, visit our video library