C++ Pointers Quiz - Question 3

Last Updated :
Discuss
Comments

What is the output of the following C++ code?

C++
#include<iostream>
using namespace std;

int main() {
    int var = 5;
    int *ptr = &var;
    cout << *ptr;
    return 0;
}

0

5

Address of var

Garbage value

Share your thoughts in the comments
Article Tags :