Hello,
I have this code:
#include<stdio.h>
int q = 10;
void fun(int *p){
*p = 15;
p = &q;
printf("%d ",*p);
}
int main(){
int r = 30;
int *p = &r;
fun(p);
printf("%d", *p);
return 0;
}
which returns 10 15
I can't understand why it doesn't return 10 10