previous | start | next

Address Operator and pointer Variables

The & operator can be applied to variables (and expressions that are bound to accessible memory locations). The result is the memory address.

If x is of type int, then &x is of type pointer to int.

Variables can be declared of type pointer to int:

      int * p; // p is of type pointer to int
   

and be assigned an address:

      int x = 5;
      int * p;

      p = &x;
   


previous | start | next