Microsoft C far pointer dereferencing

Julian Cowley julian at uhccux.uhcc.Hawaii.Edu
Thu Aug 16 14:33:29 AEST 1990


Ok, I've read the articles concerning the use of (void far *) in
Microsoft C, but I still can't figure out why the pointer in
following piece of code won't dereference.  What I'm trying to
do is access the MCGA screen at A000:0000, in case there is a
better way to do this...

PutPixel (int x, int y, unsigned char c)
{
  unsigned char far *mem;

  FP_SEG (mem) = 0xa000;
  FP_OFF (mem) = 320 * y + x;

  *mem = c;		/* <-- this line gives a run-time error */
}

julian cowley
university of hawaii at manoa
julian at uhccux.uhcc.hawaii.edu
julian at uhccux.bitnet



More information about the Comp.lang.c mailing list