-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = 58, *ptr = &n;
function(&ptr);
printf("%d ", *ptr);
return 0;
}
void function(int **ptr)
{
int k = 12;
*ptr = &k;
printf("%d ", **ptr);
}
-
- Undefined behaviour
- 58
- Segmentation fault/code crash
- 12 12
- None of these
Correct Option: D
12 12