Sail E0 Webinar
Question


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
Options:
A .  4
B .  2
C .  Depends on compiler
D .  none of the mentioned
Answer: Option C

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 ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers