Hello!
The book Programming in C / C ++ "The Bible" is, in my opinion, an excellent book, but because it is an "old book (1999, as well as the book C Complete and Total)," uses many features that are outdated, hardware technologies or C / C ++ programming language updates, I recommend reading it after you have an initial knowledge of the language, as well as, whenever you find something strange and / or some command that does not work properly, do a search on the net or pass in the stackoverflow, plus the book contains a very good didactics and was once considered one of the best on the subject.
Below is an explanation taken from the net:
Previously, x86 processors only supported one mode of operation, called real mode. In real mode the memory was divided into segments, with a fixed size of 64Kb. Programming was a big challenge. The address bus was capable of carrying only 20 bits at a time, so there was a memory address limit of 1MB (2 ^ 20). This 1MB memory was divided into 16 64 Kb segments each. A segment was divided into offsets.
The memory was addressed in two parts: Segment: Offset. So, to access a certain region, we first put the Segment address and then a position within the segment, which is the Offset.
Ex: 0007: 7B90
Well, I explained a lot, but so far I have not said anything about the NEAR and FAR pointers ... but that explanation was necessary before :).
A NEAR pointer occupied 2 bytes and could access positions only within a segment (64Kb). In fact, a NEAR pointer stored the Offset.
A FAR pointer occupied 4 bytes and was used to access an Offset on any segment. 2 bytes were used to address the segment and the other two were used for Offset.
HUGE pointers are very similar to FAR pointers, but have some advantages. In logical comparisons, for example, the segment and the Offset are compared, whereas only the Offsets are compared in the case of the FAR pointers. The downside is that addressing with a HUGE pointer is a bit slower.
The use of each pointer depended on the memory model used (SMALL, TINY, LARGE, MEDIUM, etc.). The memory model specified how the code segment and data segment were structured.
The declaration of these pointers (NEAR, FAR, and HUGE) are not part of the ANSI C standard and are not portable (they are dependent on the x86 platform).
Segmented memory is a thing of the past; running in protected mode, we now have all the memory available, in a model known as flat-memory. It is no longer necessary to distinguish between NEAR, FAR and HUGE pointers. As the memory is no longer segmented, just a pointer (which in this case is a NEAR) to access any position (in rare cases a FAR pointer is still needed ... to access the frame buffer for example). Today, CS, DS, SS point to the same 'segment'.
A hug,
André Cardona
a.k.a G @ memaster
I hope I have helped, I am also an apprentice of C / C ++ / C #, I have this book since 2000 and I really like it.
Hugs and good luck on the journey!