Vidyalelo
C++ Programming · Q35

Pointers and References in C++

Programming · C++ Programming · question 35

Q35

What will be the output of the following C++ code? #include using namespace std; int main() int n = 5; void *p = &n; int *pi = static_cast (p); cout << *pi << endl; return 0;

A.
5
Answer
B.
6
C.
compile time error
D.
runtime error

Answer: Option A

Solution

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