Q238
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 = (int*)malloc(sizeof(int)); *j = 10; return j;
A.
10
AnswerB.
Compile time error
C.
Segmentation fault/runtime crash since pointer to local variable is returned
D.
Undefined behaviour
Answer: Option A
Solution
Answer: Option A
No explanation is given for this question Let's Discuss on Board