Pointers: Am I finally grokking them??
Does this code that I cranked out give some indication that I'm getting it, or am I just dreaming in Technicolor?
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
int myAge = 65;
//int *ptr = &myAge;
int *ptr;
ptr = &myAge;
printf("The pointer lives at: %p\n", (void *) &ptr);
printf("The pointer contain the address of where my age is stored at, which is: %p", (void *)ptr);
printf("\nI'm de-referencing a pointer to fetch my age which is: %d\n", *ptr);
return 0;
}
Any and all other advise would be most welcome!
--
Duke