Vidyalelo
C Programming · Q124

Pointer

Programming · C Programming · question 124

Q124

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

A.
10
Answer
B.
Some garbage value
C.
Compile time error
D.
Segmentation fault

Answer: Option A

Solution

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