Sail E0 Webinar
Question
What is the output of this C code?
int
main()
{
int i = 10;
int *p = &i;
foo(&p);
printf("%d ", *p);
printf("%d ", *p);
}
void foo(int **const p)
{
int j = 11;
*p = &j;
printf("%d ", **p);
}
Options:
A .  11   11   11
B .  11  11 Undefined-value
C .  Compile time error
D .  Segmentation fault/code-crash
Answer: Option B


None.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers