It's undefined in a big way. Both printf() statements are trying to print an uninitialized variable. f() doesn't do jack diddly to i, as a is a copy of the address of i. You're only modifying the copy, and the original remains unchanged.
will you please again explain your last line in the last post ? f() doesn't do jack diddly.....
but , it is not playing with value of i, rather it is playing with value of a.
then why u saying that ?
Because changing where a points to has absolutely no effect on i. If you had dereferenced a and copied the value of b into it then you would have indirectly initialized i:
int f(int *a)
int b = 5;
*a = b;
But the f() you posted is completely nonsensical as it only works with the local pointer, does nothing else, and immediately loses all of those changes when the local objects are destroyed upon return.
james sir, tell me one thing, when i am storing address of local variable in a , then after that object destroys, then a will still have its adress na ?