-
What is the output of this program?
#include <iostream>
using namespace std;
int main ()
{
int Num;
int *PtrA;
int **PtrB;
Num = 1;
PtrA = &Num;
PtrB = &PtrA;
cout << Num << "\n";
cout << *PtrA << "\n";
cout << *PtrB << "\n";
cout << **PtrB << "\n";
return 0;
}
-
- 0x7ffc258d1e34
1
1
1 - 1
1
1
0x7ffc258d1e34 - 1
1
0x7ffc258d1e34
1 - 1
0x7ffc258d1e34
1
1 - None of these
- 0x7ffc258d1e34
Correct Option: C
In this program, We are printing the values and memory address
by using the pointer and dereference operator.