When using pointers, are both statements below the same? (the part in bold)
Thanks.Code:int a; int *pointer; a = 5; /* do these both mean the same? */ pointer = &a; pointer = a;
When using pointers, are both statements below the same? (the part in bold)
Thanks.Code:int a; int *pointer; a = 5; /* do these both mean the same? */ pointer = &a; pointer = a;
No. The & operator returns the adress of a variable. The value of a var. and the adress of a var. is not the same thing.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.