C | Pointer Basics | Question 11

Last Updated :
Discuss
Comments
C
#include<stdio.h> 
void f(int *p, int *q) 
{ 
  p = q; 
  *p = 2; 
} 
int i = 0, j = 1; 
int main() 
{ 
  f(&i, &j); 
  printf("%d %d", i, j); 
  getchar(); 
  return 0; 
}

2 2

2 1

0 1

0 2

Tags:
Share your thoughts in the comments