GATE CSE
First time here? Checkout the FAQ!
x
0 votes
54 views
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 ?
asked in Programming by Active (1.2k points)   | 54 views
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.

1 Answer

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.

answered by (445 points)  

Related questions

+4 votes
1 answer
1
0 votes
1 answer
2
asked in Programming by Nitesh Choudhary Active (2k points)   | 80 views


Top Users Sep 2017
  1. Habibkhan

    7142 Points

  2. Warrior

    2640 Points

  3. Arjun

    2480 Points

  4. rishu_darkshadow

    2466 Points

  5. A_i_$_h

    2214 Points

  6. nikunj

    1980 Points

  7. manu00x

    1846 Points

  8. makhdoom ghaya

    1770 Points

  9. Bikram

    1744 Points

  10. SiddharthMahapatra

    1718 Points


26,133 questions
33,705 answers
79,886 comments
31,105 users