Vidyalelo
C Programming · Q148

Pointer

Programming · C Programming · question 148

Q148

What will be the output of the following C code? #include int *f(); int main() int *p = f(); printf("%d ", *p); int *f() int j = 10; return &j;

A.
10
Answer
B.
Compile time error
C.
Segmentation fault/runtime crash
D.
Undefined behaviour

Answer: Option A

Solution

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