what is the size of *ptr in a 32-bit machine, (assuming initialization as int *ptr = 10;)?
Answers
Answered by
0
A pointer is a variable which stores memory address of another variable assigned to it
for example :
int s = 10;
int *ptr ;
ptr =s ; // pointer initialised
A memory required by pointer totally depends on the bits of machine
Suppose if you have 32 bits machine a pointer will require 32 bits (4 bytes ) of memory to be stored .
And if your machine is a 62 bits machine then a pointer will require 62 bits (8 bytes ) of memory to be stored .
Regardless of what data type they are pointing to, they have fixed size.
(As you have specified in the questions that "a integer pointer" data type doesnt matter dear!!)
thats it
Similar questions
Math,
7 months ago
English,
7 months ago
Environmental Sciences,
7 months ago
Sociology,
1 year ago
Social Sciences,
1 year ago