Vidyalelo
C Programming · Q39

Pointer

Programming · C Programming · question 39

Q39

What will be the output of the following program? #include void main() int i = 10; void *p = &i; printf("%d ", (int)*p);

A.
Compiler time error
Answer
B.
Segmentation fault/runtime crash
C.
10
D.
Undefined behavior

Answer: Option A

Solution

Answer: Option A
Solution:

p is pointer of type void.