Top

Discussion

What will be the output of the following C code?

#include 
    void foo(int*);
    int main()
    {
        int i = 10;
        foo((&i)++);
    }
    void foo(int *p)
    {
        printf("%d\n", *p);
    }

 

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

Answer: C

No answer description available for this question.

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

Post your comment