Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!pacbell.com!pacbell!att!cbnewsc!tjr From: tjr@cbnewsc.att.com (thomas.j.roberts) Newsgroups: comp.lang.c Subject: Re: Microsoft C far pointer dereferencing Message-ID: <1990Aug20.143339.29933@cbnewsc.att.com> Date: 20 Aug 90 14:33:39 GMT References: <7990017@hpopd.HP.COM> Organization: AT&T Bell Laboratories Lines: 25 From article <7990017@hpopd.HP.COM>, by richardh@hpopd.HP.COM (Richard Hancock): > / hpopd:comp.lang.c / mfinegan@uceng.UC.EDU (michael k finegan) / 10:30 pm Aug 16, 1990 / > >>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 */ >>} In Turbo C, the FP_SEG(mem) = ...; statement gets "not an lvalue" error. In Turbo C you should use: mem = MK_FP(0xA000,320*y+x); *mem = c; Turbo C has the FP_SEG() and FP_OFF() macros as used above, and the MK_FP() macto to create a far pointer; I assume Microsoft C does also, but have no experience at all using Microsoft C. Tom Roberts att!ihlpl!tjrob