#include<stdio.h>
#include<string.h>
void fn (int *ptr)
{
static int val=100;
ptr=&val;
}
main()
{
int i=10;
printf("%d", i);
fn(&i);
printf("%d", i);
getch();
}
The output of the above code is 10 10.
why not 10 100?
What is happening inside fn?