Discussion Forum : Pointers
Question -

What is the output of this program?

#include < iostream >

using namespace std;

int main()

{

int a = 5, b = 10, c = 15;

int *arr[ ] = {&a, &b, &c};

cout

Options:
A .  5
B .  10
C .  15
D .  it will return some random number
Answer: Option D


Array element cannot be address of auto variable. It can be address of static or extern variables.



Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *