Vidyalelo
C++ Programming · Q8

Pointers and References in C++

Programming · C++ Programming · question 8

Q8

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

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

Answer: Option C

Solution

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