Type of Pointers
int x;
char c;
float f;
int* ptx;
char *ptc;
float *ptf;
ptx = &x; /* OK */
ptx = &c; /* WRONG */
ptc = &c; /* OK */
ptf = &f; /* OK */
ptf = &x; /* WRONG */
Int pointer can hold address of int variable only. Char pointer can hold address of char variable only.
Previous slide
Next slide
Back to first slide
View graphic version