Page t040, go to NEXT, PREVIOUS, INDEX

Pointers Arithmetic


A pointer can point to element of an array

      float x[5];
      float *y = &x[0];
      float *z = x;

What's wrong here?

      float x[5];
      float* y, z;
      y = x;    /* OK */
      z = x;    /* WRONG */

C Course, 22-jan-1997, Peter Klok, pfk@hef.kun.nl