Q:\Documents\others\Software Design II\software design 2\pointers tutorial\pointer.c
06 November 2009 23:57
/*pointers story infolded*/ //using the &(address calling) and *(address allocation) operators #include <stdio.h> int main(void) { int a; //a is an integer int *aPtr; // aPtr is a pointer that points the address 'aPtr'. this pointer is used for an integer a = 7; //integer is allocated to the variable 'a' aPtr = &a; //aPtr will be allocated to the contents of whatever is in the address of 'a' printf("the address of 'a' is %p" "\nthe value of aPtr is %p", &a, aPtr); printf("\n\nthe value of a is %d\nthe value of *aPtr is %d" , a, *aPtr); printf("\n\nshowing that * and & are complements of eachother\n&*aPtr = %p\n*&aPtr = %p\n" ,&*aPtr,*&aPtr); }
-1-