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 ?
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...