in Programming in C
544 views
0 votes
0 votes
In a 16-bit machine
Size of  Int Size of pointer are same ?

What I knew is 8bit = 1B

Char will take -> 1 B
Int -> 2B

if integer pointer  size is p then size of flot / double / int pointer is p itself  , right ?
in Programming in C
544 views

1 comment

The size of a pointer doesn't depend on the datatype they are pointing to. Your last statement is correct (at least for how much we are concerned), that size of pointer to integer should be same as pointer to any other data type, but that may depend on several complex factors (I would suggest googling and reading stackoverflow articles, but that maybe time consuming). One thing to note: size of integer and size of pointers are not related at all. It's just a coincidence that on some systems you'll get size of integer = size of pointer.
0
0

1 Answer

0 votes
0 votes

INT , FLOAT , DOUBLE all are  different data types = > size of the pointers will also be differet depending on the type  you have declared.