Pointers - Introduction
Pointers are special variables that store “the address” of another variable. Definition:<type> * <variable name>
float f1;float * pf1; /* pf1 is a pointer to float */pf1 = &f1;
& is the address operator:&<variable> gives the address of <variable>(no matter what <variable> is)
* is the “value of” operator:float f1 = 1.0, f2 = 2.0;float * pf1= &f1;f2 = *pf1; /* now the value of f2 is 1.0 */
Pointers in memory - drawing