C - Pointers and Arrays2
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
Pointers and Arrays ...
If pa is a pointer to an integer declared as
Then the assignment
pa = &ar;
Sets pa to point to element zero of ar; i.e, pa contains the address of ar.
Since the name of an array is a synonym for the location of the initial element, the assignment pa = &ar can also be written as pa = ar.
Now the assignment
x = *pa;
Will copy the contents of ar into x.