Vidyalelo
C Programming · Q225

Pointer

Programming · C Programming · question 225

Q225

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

A.
11 11
Answer
B.
Undefined behaviour
C.
Compile time error
D.
Segmentation fault/code-crash

Answer: Option A

Solution

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