
Dynamic Memory Allocation 581
Explanation: In the above program, the pointers f, n, and h are declared. In the pointer dec-
laration, the pointers are preceded by the keywords far, near, and huge. The sizeof()
operators display the size of the pointers in bytes.
14.3 Write a program to use far pointer.
#include<iostream.h>
#include<constream.h>
int main()
{
clrscr();
char far *s; // pointer declaration
s=(char far*)0xB8000000L; // starting address
*s=‘W’; // displays character on the screen
return 0;
}
OUTPUT
W
Explanation: Character pointer *s, which is a far pointer, is declared. The address
0xB8000000L is assigned to it. It is ...