INF: Using printf() with Far Pointers in Small Model Programs

ID Number: Q29281

3.00 4.00 5.00 5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.0, 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version

7.0, to use printf() to print data items (strings and pointers only)

that have been declared as far in a small- or medium-memory model, use

F to modify the %s or %p field. For example, if you have the following

declaration

char far *ptr;

you can print out the value of the pointer with the following call:

printf("%Fp",ptr);

You also can print out the string pointed to by ptr (assuming that it

has been initialized in your code) with the following call:

printf("%Fs",ptr);

For additional information on the use of the F specifier with

printf(), refer to the C run-time library reference or online help

that was supplied with your particular version of the compiler.

Additional reference words: 5.00 5.10 6.00 6.00a 6.00ax 7.00