Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - a segment object based pointer derives its segment value from another named http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A segment object based pointer derives its segment value from another named
object.  A segment object based pointer is specified as follows:


     [type] __based( segment ) *name;

where segment is an object defined as type __segment.

An object of type __segment may contain a segment value.  Such an object is
particularly designed for use with segment object based pointers.

The following example illustrates a segment object based pointer:

Example:

     __segment            seg;
     char __based( seg ) *cptr;

The object seg contains only a segment value.  Whenever the object cptr is
used to point to a character, the actual pointer value will be made up of
the segment value found in seg and the offset value found in cptr.  The
object seg might be assigned values such as the following:

 .  a constant value (e.g., the segment containing screen memory),
 .  the result of the library function _bheapseg,
 .  the segment portion of another pointer value, by casting it to the type
    __segment.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson