-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int num = 12;
int *ptr = #
foo(&ptr);
printf("%d ", *ptr);
printf("%d ", *ptr);
}
void foo(int **const ptr)
{
int k = 13;
*ptr = &k;
printf("%d ", **ptr);
}
-
- Undefined-value
- 13 13 13
- Compilation Error
- Segmentation fault/code-crash
- None of these
Correct Option: B
13 13 13