answersLogoWhite

0

It used to be a good question 30 years ago.

Right know you don't have to know anything about near and far pointers; but if you still use a 16-bit compiler, select 'Large Model' (or 'Huge Model'), and forget 'near' and 'far'

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Engineering

What are near pointers in c?

Just forget it, it was a question twenty years ago when we worked in MS-DOS with a 16/20 bit CPU. Near pointers contain 16 bits, far pointers contain 32 bits (but only 1MB (or 1MB+65520 bytes) are really addressible).


Why Near pointers are used for all code and data references in huge memory model for turbo C?

You may have misunderstood something. Choose Huge Model,and forget about near and far. (Honestly, this topic is outdated by twenty years!)


What is near far and huge pointers How many bytes are occupied by them?

Near, far, and huge pointers are different types of pointers used to reconcile the different addressing models of the Intel 8086/8088 class processors, running in a 16-bit operating system such as Windows 3.x, as well as any of the newer incarnations running in real mode or virtual 8086 mode.A near pointer can address something within one 64Kb memory segment, containing only an offset, and it takes two bytes. The segment is implied by context, and is usually the data segment, selected for the addressing model.A far pointer can address anything in the 1Mb memory1, containing both a segment and an offset, and it takes four bytes.A huge pointer is a normalised far pointer, which means its offset part is always between 00H and 0FH.In 32-bit mode a pointer can address anything in 4Gb memory, containing a flat 32-bit offset, and it takes four bytes. (In this mode segments have no significance.) It only works, however, when there is support for it, such as the WIN32 extension of Windows 3.x.---------------------------------------------------------------------------------------1In the 80286 or higher, running in protected mode, in OS/2, the segment portion of the pointer is actually a descriptor selector, so 1Mb addressibility depends on the operating system environment.far huge near pointer is an oxymoron. far points to memory outside of the normal address space. near points to memory within the normal address space, is the default, and usually is not needed. I've never seen huge before. What is the target architecture?Near, far, and huge pointers are a construct (usually) in the Win16 environment running on an 8086/8088 or later in real mode, such as Visual C/C++ 1.52. In this environment, near pointers are 16 bits, and far and huge pointers are 32 bits.


In C you use the concept of pointers whereas there are no pointers used in JAVA why?

Pointers in C are generally the thing that gives learners the most trouble. When C code is not written correctly with respect to pointer use, the resulting bugs can often be very difficult to find and correct. On the other hand, pointers are absolutely necessary in some cases.The designers of Java wanted to make programming easier and hence avoided adding pointers to the language. Java does have object references which accomplish much of what pointers accomplish albeit in a safer way.


Why pointer is callded jewel of c language?

a pointer is a derived data type in c. pointers are undoubtedly one of the most distinct and exciting features of c language.it has added power and flexibility to the language. *pointers are more efficient in handling arrays and tables. *pointer can be used to support dynamic memory management. *pointers reduce length and complexity of programs. *increase the execution speed and thus reduce the program execution time. by following character's real power of c lies in proper use of pointers. pointer is called the jewel of c-language.

Related Questions

Why are header files not required when using far and near pointers?

In C programming, header files are required. It doesn't matter if you are using near pointers, far pointers, both, or neither -- you still need header files. There is no connection between the necessity of header files and the pointers' size.


What are near pointers in c?

Just forget it, it was a question twenty years ago when we worked in MS-DOS with a 16/20 bit CPU. Near pointers contain 16 bits, far pointers contain 32 bits (but only 1MB (or 1MB+65520 bytes) are really addressible).


What settings do you need to use far keywords and other c style syntax in our programs while writing programs in VC?

There are no settings. Near and far pointers are specific to segmented memory models but when working with virtual memory models we always use normalised pointers which are always the same length (in bits). Near pointers use fewer bits than normalised pointers (usually half as many bits) because they only refer to the offset address within the current segment. Far pointers are similar to normalised pointers, except the high-order word refers to the segment address and the low-order word refers to the offset within that segment.


Why Near pointers are used for all code and data references in huge memory model for turbo C?

You may have misunderstood something. Choose Huge Model,and forget about near and far. (Honestly, this topic is outdated by twenty years!)


What is the memory representation of far and near pointers in C?

In Intel 16-bit x86 architecture, memory was arranged in 64K segments. Two 16-bit words were used to address a specific memory location; 16 bits to identify the segment and 16 bits to identify the offset within that segment. A near pointer only requires 16 bits of storage because it refers to memory as an offset into the current segment whereas a far pointer requires the full 32 bits. However, near pointers are only useful in tiny, small or medium memory models. In all other models, pointers are far by default and introducing an explicit near pointer would be disastrous. In 32-bit architecture, there is only one segment of 4GB starting at address 0x0, therefore the concept of near and far pointers is not an issue.


How can you access the administrator password using pointers in C?

i don't have any knowledge about your ques. but i guide you to read the "Writing TSR through C" & learn knowledge of FAR & HUGE ponters.by this you can access the adminstrator password using pointers in C.


What is the difference between c plus plus and java programming?

Java doesn't have pointers. C++ has pointers.


What is stream pointer in c?

C does not have stream pointers.


What are huge and dangling pointers in C language?

A huge pointer was a special type of pointer used in the WIN161 environment that would allow you to monolithically handle objects of size greater than 64KB as if that were one single address space. If you had the special WIN32 add-on installed, you could declare and use huge pointers natively, but normally, you had to do address translation to go from huge to far and from far to huge.A dangling pointer is not something I have heard of. The closest I can interpret this is a misunderstanding of dangling if statements, although it could be a reference to leaking memory through unallocated pointers that go out of scope before they are freed. Please restate the question, with better details.1 Today, with true 32 and 64 bit operating systems abounding, the concept of near, far, and huge pointers is obsolete and archaic. The need to deal with them disappeared with Visual Studio 1.52 and Windows 3.1. (Of which I still have working copies. :-)>)


What is near far and huge pointers How many bytes are occupied by them?

Near, far, and huge pointers are different types of pointers used to reconcile the different addressing models of the Intel 8086/8088 class processors, running in a 16-bit operating system such as Windows 3.x, as well as any of the newer incarnations running in real mode or virtual 8086 mode.A near pointer can address something within one 64Kb memory segment, containing only an offset, and it takes two bytes. The segment is implied by context, and is usually the data segment, selected for the addressing model.A far pointer can address anything in the 1Mb memory1, containing both a segment and an offset, and it takes four bytes.A huge pointer is a normalised far pointer, which means its offset part is always between 00H and 0FH.In 32-bit mode a pointer can address anything in 4Gb memory, containing a flat 32-bit offset, and it takes four bytes. (In this mode segments have no significance.) It only works, however, when there is support for it, such as the WIN32 extension of Windows 3.x.---------------------------------------------------------------------------------------1In the 80286 or higher, running in protected mode, in OS/2, the segment portion of the pointer is actually a descriptor selector, so 1Mb addressibility depends on the operating system environment.far huge near pointer is an oxymoron. far points to memory outside of the normal address space. near points to memory within the normal address space, is the default, and usually is not needed. I've never seen huge before. What is the target architecture?Near, far, and huge pointers are a construct (usually) in the Win16 environment running on an 8086/8088 or later in real mode, such as Visual C/C++ 1.52. In this environment, near pointers are 16 bits, and far and huge pointers are 32 bits.


What is decleration part in C programming?

pointers.


What is the difference between pointers in c and c plus plus?

Nothing.