GATE CSE
First time here? Checkout the FAQ!
x
0 votes
50 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)   | 50 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 (335 points)  

Related questions

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


Top Users Jul 2017
  1. Bikram

    3782 Points

  2. manu00x

    2464 Points

  3. Debashish Deka

    1832 Points

  4. joshi_nitish

    1494 Points

  5. Arnab Bhadra

    1096 Points

  6. Arjun

    1054 Points

  7. Hemant Parihar

    1050 Points

  8. Shubhanshu

    972 Points

  9. Ahwan

    876 Points

  10. akash.dinkar12

    642 Points


23,953 questions
30,895 answers
70,108 comments
29,272 users