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;
Printable View
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.