What is the output of the following C++ code?
#include<iostream>
using namespace std;
int main() {
int var = 5;
int *ptr = &var;
cout << *ptr;
return 0;
}
0
5
Address of var
Garbage value
This question is part of this quiz :
Quiz on C++ Pointers