The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
58 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.3k points) | 58 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 (405 points)

Related questions

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


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

28,947 questions
36,793 answers
91,077 comments
34,690 users