Friday, February 7, 2020

C: Far Pointer: research

Far pointers are a specialty of the 8086 architecture. Unless you are going to write DOS or Windows 16 programs, you won't ever need to use them. Far pointers aren't part of standard C either and do not exist on other platforms.

Answer from Link #1 is good and clear one:If does nothing unless you happen to be using a 16 bit x86 compiler.

If you look in the Win32 header WinDef.h (in Visual Studio, simply right-click the word FAR in the source and select "Go to Definition", you will see that it is a macro defined as far, which in turn is also a macro defined as nothing at all!

It is only there to allow the compilation of legacy Win16 source as Win32. In 16 bit x86 compilers, far was a compiler extension keyword to support seg::offset pointers which resolve to a 20bit address (16 bit x86 only had a 1Mb address space!). They are distinct from 16 bit near pointers which comprised only the ::offset from the current segment.

  1. What does Far mean in c?
  2. Far pointer
  3. difference between far and huge pointers
  4. What are near, far and huge pointers?
  5. near, far and huge pointers in C
  6. Far pointer in c programming
  7. What is meant by Near, Huge and Far Pointers in C programming
  8. What is the use of Far Pointer and how it works?
  9. C Programming dangling pointer
  10. What is a dangling pointer?
  11. Dangling, Void, Null and Wild Pointers in C++
  12. Dangling, Void , Null and Wild Pointer in C
  13. Dangling Pointer in C
  14. What is dangling pointer in c?
  15. What is Dangling Pointer with Cause and How to avoid it?
  16. Dangling pointer

No comments:

Post a Comment