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


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