Question
1.
#include
2.
using namespace std;
3.
int main ()
4.
{
5.
int a;
6.
int * ptr_b;
7.
int ** ptr_c;
8.
a = 1;
9.
ptr_b = &a;
10.
ptr_c = &ptr_b;
11.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main ()
4.
{
5.
int a;
6.
int * ptr_b;
7.
int ** ptr_c;
8.
a = 1;
9.
ptr_b = &a;
10.
ptr_c = &ptr_b;
11.
cout
Answer: Option C
Was this answer helpful ?
Answer: (a)
Explanation:In this program, We are printing the values and memory address
by using the pointer and derefernce operator.
Output:
$ g++ def2.cpp
$ a.out
1
1
0xbffc9924
1
Was this answer helpful ?
More Questions on This Topic :
Question 2.
Pick out the correct option.
....
Question 5.
Which is used to do the dereferencing?
....
Submit Solution