>what is the difference between & and *?
& retrieves the address of a variable. It says "give me the address of the variable, not the contents".
* dereferences a pointer. It says "go to the address contained in this variable and give me the contents of that address".
Run this and play around with * and & to see what they both do.
-PreludeCode:#include <stdio.h> int main ( void ) { int i = 10, *p = &i; printf ( "& on i: %p\n", &i ); printf ( "* on p: %d\n", *p ); return 0; }