Vidyalelo
C Programming · Q1

C Miscellaneous

Programming · C Programming · question 1

Q1

Determine output: void main() int const *p=5; printf("%d", ++(*p));

A.
6
B.
5
C.
Garbage Value
D.
Compiler Error
Answer

Answer: Option D

Solution

Answer: Option D
Solution:

p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".