Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!think!ames!lll-tis!lll-lcc!unisoft!hoptoad!academ!killer!toma From: toma@killer.UUCP (Tom Armistead) Newsgroups: comp.lang.c Subject: Re: Turbo Pascal to C conversion Message-ID: <1118@killer.UUCP> Date: Thu, 9-Jul-87 23:08:44 EDT Article-I.D.: killer.1118 Posted: Thu Jul 9 23:08:44 1987 Date-Received: Sun, 12-Jul-87 18:01:13 EDT References: <8201@brl-adm.ARPA> Organization: The Org. for the Disorg. of Org. Lines: 46 Summary: Use pointers In article <8201@brl-adm.ARPA>, JOER%TEMPLEVM.BITNET@wiscvm.wisc.EDU (Joseph Raube) writes: > procedure pack(var page : pagetype ; > key : integer ); > var > i : integer; > p : array[1..maxint] of byte ABSOLUTE page ; > begin > ... > end; > > how do I convert the ABSOLUTE reference to C ??? > Joe Raube Templevm@bitnet Use pointers... Something like this void pack(page, key) pagetype *page; int key; { /* now any references to page will actually be accessing what */ /* page points to (thus 'absolute') */ pagetype *p; p = page; /* now p 'points' to the same thing as 'page' */ /* and any changes to one will affect the other... */ } /* and when you call pack, pass the 'page' parameter with an 'address of' */ /* operator in front of it, like this... */ main() { pagetype apage; int akey; /* do your stuff with apage and akey */ pack(&apage, akey); /* now any refferences made to the apage variable in the pack routine will */ /* be made to the actual apage variable... */ } UUCP: ihnp4\ \killer!toma infoswx!convex!dj3b1/ Tom Armistead