Top

Discussion

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);
}

 

  • A.10
  • B.Some garbage value
  • C.Compile time error
  • D.Segmentation fault

Answer: A

No answer description available for this question.
 

No comment is present. Be the first to comment.
Loading…

Post your comment