Just for clearnce , any pointer in C++ is consistes of 4 bytes so it is the same size (in 32bits platform) as int , unsigned int , long , and even float type.
So what is the problem?
Actually the problem may take place when you use the pointer as an array to get what it holds, i.e dereference it.
For example
Suppose you have a pointer to int type and an other one for byte type and want to use them as an arrays to get the 4 th element from the beginning.
int *int_ptr; // I am integer pointer , size of integer is 4 bytes.
byte *byte_ptr; // I am byte pointer , size of byte is 1 bytes.
int int_val = int_ptr[3];
/*
C++ compiler will multiply 3 * size of int type (i.e 4 bytes) to get the address of 4 th element . i.e address = int_ptr + 3 * size of int type (4 bytes) = int_ptr + 12 bytes
*/
int int_val = byte_ptr[3];
/*
C++ compiler will multiply 3 * size of byte type (i.e 1 byte) to get the address of 4 th element . i.e address = byte_ptr + 3 * size of byte type (1 byte) = byte_ptr + 3 bytes
Which is wrong address. And the compiler will fire a warning.
*/
Note well
some times you do want to get a certain byte from an integer value , so you use a byte pointer to get the desired byte but with explicitly casting type
for example
this get the second byte from integer value ,
int int_val ;
byte* byte_ptr = (byte*) & int_val ;
byte mySecondByte = byte_ptr[1];
hope that will make things more clear , and sorry for my bad English.