Assignment of pointers: Type checking of pointers in C++

When you are assigning one pointer to another you have to make sure that they are of same type.

For Example:

For Pointers:

int *pi;

float *pf;

The statement pi = pf; will give an error because both these pointers are of different types.

Leave a Reply