Q:

Guess the output

0

Guess the output

#include <stdio.h>
    int main()
    {
        int i = 97, *p = &i;
        foo(&i);
        printf("%d ", *p);
    }
    void foo(int *p)
    {
        int j = 2;
        p = &j;
        printf("%d ", *p);
    }

  1. 2 2
  2. 2 24
  3. 2 97
  4. Compilation error

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

2 97

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now
What are the different ways to initialize an array... >>
<< The declaration int (*p) [5]; means...