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


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