answersLogoWhite

0

Far pointer size in C plus plus?

Updated: 8/11/2023
User Avatar

Wiki User

14y ago

Best Answer

If you are talking "far pointer", then you are probably talking about real mode in a 16 bit environment such as DOS or Windows 3.1, or in Virtual 8086 mode in Windows 95 or higher. In this mode, addressing is segmented into 65536 segments of 65536 bytes each, but each segment overlaps the next by only a 16 byte offset. This gives you addressability to 1048576 bytes. A far pointer is a 32 bit object, containing a 16 bit segment and a 16 bit offset. int __far *p; /* a far pointer called p which points to an int */

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

A far pointer is 4 bytes; 2 bytes for the segment, and 2 bytes for the offset.

Far and near pointers were used in older, obsolete environments based on the 8086/8088 architecture, such as Windows 3.x and DOS. Modern operating systems, such as Windows XP, Vista, or 7, on a newer processor such as a Core 2, use a linear space where the pointer is more correctly called a huge pointer - the terms near and far are no longer used.

Note: sizeof (char far *) will tell you in bytes.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Far pointer size in C plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is Dazzling Pointer in c plus plus?

The pointer that points to a block of memory that does not exist is called a dazzling pointer or wild pointer


Is type checking on pointer variables stronger in assembly language or in c plus plus?

C++ imposes far greater restrictions on pointer typing than assembly language. There is only a single type of pointer in assembly, which is only "typed" in any sense when dereferenced, and even then only by size. C++ pointer typing takes into account not only the size of the type of the referent, but a number of other factors, such as its relationship to other types in the class hierarchy. The only way to disable these safety checks is to explicitly break the type system using reinterpret_cast.


What is 'this' pointer in c plus plus?

Address of the current object.


What is null object in c plus plus?

a pointer that is not pointing to anything


What is an address in C plus plus programming?

An address in C or C++ is the location in memory of an object or function. An address is the contents of a pointer, as opposed to the contents of the memory location pointed to by the pointer.


What is far pointer in c language?

its pointer created for high safety that cant be find by anyone.


Define pointer in C?

Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


What does multiplying a pointer by 5 in C plus plus mean How does it change the pointer's value?

Multiplication is yet another thing, what you should never do with pointers.


Which function is used to determine the position of the put pointer in a file in c plus plus?

The function ftell returns the position of the file pointer for a file.


How do you change scrin coulor using far pointer in c ganguage?

brown


Do you have pointer concept in c plus plus language?

Yes. All string variables are pointers as are other arrays.


What is the concept of asterisk in c plus plus?

An asterisk in C++, such as int *data, is what's known as a pointer. A pointer is like a regular variable, but instead of holding a value, a pointer holds the memory location of the value. It's a somewhat difficult concept, and you can learn more about it here: See related links section below...