|
| Total Answers and Comments: 7 |
Last Update: March 11, 2008 Asked by: anupam verma |
|
| | |
|
Submitted by: manishmodgil The size of any pointer variable is same. ( 2 byte in case of 32 bit machine ).
The type of pointer defines the type of data the pointer is pointing to .
eg. if the pointer is definde as
int *p;
then it will create a pointer p ( of two bytes ) which is pointing to a data of type int ( again of 2 byte ) .
If we create
float *pf;
it will create a pointer ( again of 2 bytes ) but pointing to a float ( of 4 byte ).
The difference makes sense when we try to read or move to the next block etc.
suppose we created a char type pointer to an int then while reading, it will just read the first byte leaving the second byte of int thus giving us wrong output.
Above answer was rated as good by the following members: aman15490 | Go To Top
|