In real mode far pointers are 32 bit long (segment + offset)
In protected mode 48 bit (16 bit segment + 32 bit offset)
(In 64-bit mode 80 bit (16 nit segment + 64 bit offset) but it's not so useful)
On far pointers the comparison operators(== and !=) check the 32 bit value. While >, =,
pencil pointer
Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.
its pointer created for high safety that cant be find by anyone.
It has to be a pointer all right.Regarding 'far' and 'near': forget it, simply use 'Large' data modell (or 'Huge').
It is a matter of the memory model you are using. On old or embedded systems, some memory was outside of the range of a normal pointer. If you have 4 megs of ram you need at least a 22bit pointer to see all of it. But let's say you only have a 16 bit pointer. This means you can only access the first 65K of ram. Odd as it may sound, this was a problem on old computers, and is sometimes an issue on embedded devices with limited processing power. The near and far classifications were a solution. Pointers are near by default. In my example above, the 65K of ram would be accessed with a near pointer. To get past that 16 bit limit, you need a far pointer. Thus: memory within the pointer's range is near. Memory outside of the range is far. Near pointer: char near * ptr; Far pointer: char far * ptr;A far pointer uses both the segment and the offset address to point to a location in memory. A near pointer in contrast uses only the offset address and the default segment. The far pointer can point to any location in memory, whereas the near pointer can only point to a nearby local address.Something that was important 20 years ago. Now you can forget it.
Yes but only if it is defined as a pointer and memory is dynamically assigned to the pointer.
Pointer is a variable that stores the address of another variable . So pointer basically stores the address of another variable and size of pointer can be evaluated by using sizeof operator.
It depends on the platform... In a 16 bit environment, such as DOS or Windows 3.x, a near pointer is two bytes, while a far pointer is 4 bytes. In a 32 bit environment, such as Win32, a pointer is 4 bytes. In a 64 bit environment, such as Win64, a pointer is 8 bytes. If you want to find out in your particular environment, look at sizeof(ptr), where ptr is declared as a pointer to something. char* ptr; std::cout << sizeof(ptr) << std::endl; Note that the size of the pointer is not the same as the size of the object to which it points. If you looked at sizeof(*ptr), you would get 1.
200 miles
10 ft
function pointer is a variable that hold the address of any function which declared in the program but function pointer is the array of the function that accept the run time size of the function.