previous | start | next

Don't Mix Types

If y is of type int and p is of type pointer to int, p should not be assigned to y. The types don't match:

Example:

      int x = 5;
      int y;
      int * p = &x;

      y = p;  // NO! y is an int; p's value is the address of x, not
              // the int value of x.

      p = 6;  // NO! 6 is an int, not a pointer to int;
   


previous | start | next