Pointer Exercise


     int x,z;
     float y;
     char ch, *chp;
     int *ip1, *ip2;
     float *fp;

     x = 100;
     y = 20.0;
     z = 50;


     ip1 = &x;
     ip2 = &z;
     fp  = &y;
     chp = &ch;

     ip2 = ip1;

     ip1 = &z;

     *ip1 = *ip2;

     *ip1 = 200;

     *ip1 = *ip2 + 300;

     *fp = 1.2;

     printf("%f\n", *fp);

     printf("%d\n", ip1);

     printf("%d\n", *ip1);


[up] to Overview.