Vidyalelo
C++ Programming · Q3

Pointers and References in C++

Programming · C++ Programming · question 3

Q3

What is the output of the following code: int x = 5; int *ptr = &x; cout << *ptr; in C++?

A.
Address of x
B.
Garbage value
C.
Compilation error
D.
5
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board