Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Looking for C functions to access PC memory Message-ID: <5640@utcsri.UUCP> Date: Mon, 9-Nov-87 19:17:23 EST Article-I.D.: utcsri.5640 Posted: Mon Nov 9 19:17:23 1987 Date-Received: Tue, 10-Nov-87 03:06:48 EST References: <24261F3U@PSUVMB> <447@ucdavis.ucdavis.edu> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Organization: University of Toronto Lines: 16 Keywords: Using pointers in C Xref: utgpu comp.sys.ibm.pc:8476 comp.lang.c:5062 Summary: In article <447@ucdavis.ucdavis.edu> kwok@iris.UUCP (Conrad Kwok) writes: > char far *ptr; > > ptr = (char far *) 0xC0000100L; > printf("Value at 0xC000:0x0100 is %d\n", *ptr); bad style. avoid temporaries; the reader can't determine (easily) for how long the variable is used. restricting values to an expression, by not storing them in variables, is modular in the same way that restricting values to a function by storing them in local variables is. use instead: printf("contents of C000:0100 is %d\n",*(char far *)0xc0000100L); ajr