Vidyalelo
C++ Programming · Q12

Pointers and References in C++

Programming · C++ Programming · question 12

Q12

What is the output of the following code: int arr[3] = 1, 2, 3; int *ptr = arr; cout << *(ptr + 1); in C++?

A.
1
B.
3
C.
2
Answer
D.
Garbage value

Answer: Option C

Solution

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