If we consider a pointer variable if takes size of 2 bytes and it can carry max address value of 65535 but actual address are larger than 65535 , how it is able to manage these address..... will u please explain me.

8 Years
Discussion Span
Last Post by Alibeg

> If we consider a pointer variable if takes size of 2 bytes
Jeez, how old is your compiler?


you are talking about the oldest, i believe, compilers made. they used (and still use somewhere if they exist) 2 bytes to store a memory location. that number refered to a location in previously determined piece of memory, the segment, which was fixed and was less than 65 536 bytes. those were near pointers. there were also far pointers that used 4 bytes. first 2 refered to segment and other 2 on offset. but those were used in maybe The Oldest compilers.
different compilers use different sizes for each variable type. you can always check their size using sizeof() function, where you enter a variable or a variable type to check its length (size).
so answer on your question would be that they can, and even have no problem doing it, because:
1. they were used on old compilers that were running on machines with poor memory, less than 64KB
2. they dont have access to whole memory but just fixed, predetermined part of memory with size smaller or equal to 65 536
i learned this from an old book written long ago when old compilers were used

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.