home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
- From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
- Subject: Re: Peek/Poke in C
- References: <BV5XVB5w165w@blackwlf.gwinnett.com>
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Fri, 18 Dec 1992 11:59:35 GMT
- Message-ID: <behrenss.724679975@hphalle6>
- Lines: 25
-
- >ericwebb@blackwlf.gwinnett.com (eric webb) writes:
- >>Hi again.. does anyone know how to do equivalent of BASIC's PEEK & POKE
- >>statements in C?
-
- Very implentation-specific. Some architectures allow something along
- the lines of
-
- char *address;
-
- address = 0x678090;
- *address = 80; /* poke $678090,80 */
- printf ("And peek gives us: %d\n",*address);
-
- This will, of course, only work on those architectures where a pointer
- actually contains a physical address, which is a rare case anyway.
-
- My advice: Stay away from PEEK and POKE. If you absolutely have to do
- it, at least put it in its own source file and comment it heavily.
-
- Soenke
- --
- ===========================================================================
- More than silver, more than gold, I need ! behrenss@informatik.
- electricity. I need it for my dreams. ! tu-muenchen.de
- (RACTER) ! FIDO: 2:246/13 Soenke Behrens
-