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.

Recommended Answers

All 2 Replies

> 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

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.