/* * pointers.c * * examples of how pointers work, * made to help me remember them * * By C. Spitzer */ int *p; // this initializes a pointer int i = 1; int *p = &i; // this initializes a pointer and gives it the value of // the address of i (& means address of) int i, *p; p = &i; // This does the same as above ^ ********* int i, j, *p, *q, *s; i = 3; p = &i; q = p // Now q points to the same memory location as p *q = *s // Read, set q to point to the same thing that s points to ********* // What does the star preceding max (*max) mean in the following // declaration? int *max(int *a, int *b) // I know the int *a and int *b mean pointers named 'a' and 'b' // Does *max mean that max returns a pointer to an int, // rather than an int?