Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main ()
{
    int a;
    int * ptr_b;
    int ** ptr_c;
    a = 1;
    ptr_b = &a;
    ptr_c = &ptr_b;
    cout << a << "\n";
    cout << *ptr_b << "\n";
    cout << *ptr_c << "\n";
    cout << **ptr_c << "\n";
    return 0;
}

A. 1
1
0xbffc9924
1

B. 1
1
1
0xbffc9924

C. 1
0xbffc9924
1
1

D. 0xbffc9924

Answer: Option A


Join The Discussion

Related Questions on Classes and Objects in C plus plus