Hello every one, I got a interview and 1 of interviewer ask me that Howmany byte is a pointer? I can not answer this question. seem it is trick question. All I know is pointer is an address location where the pointer point to.
Anyone get input to make it clear would be appreciate.
thanks
quocnam00
0
Newbie Poster
Recommended Answers
Jump to PostAsk him/her what platform.
Jump to PostIt depends on the platform. Since a pointer is an address, it must be big enough to store the largest address. I'm fairly sure that in windows addresses are 32bits (4 bytes). In linux/unix it may be different.
Jump to PostIt's 4 bytes on a 32-bit system (reason for a 4GB RAM limit), and 8 bytes on a 64-bit system. I believe you can check using something like sizeof(void*).
All 9 Replies
MosaicFuneral
812
Nearly a Posting Virtuoso
mahlerfive
23
Junior Poster in Training
nmaillet
97
Posting Whiz in Training
ArkM
1,090
Postaholic
Narue
5,707
Bad Cop
Team Colleague
nmaillet
97
Posting Whiz in Training
jbennet
1,618
Most Valuable Poster
Team Colleague
Featured Poster
ArkM
1,090
Postaholic
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.