home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!ucbvax!PUCC.PRINCETON.EDU!JSAVIT
- From: JSAVIT@PUCC.PRINCETON.EDU (Jeff Savit)
- Newsgroups: comp.lang.modula2
- Subject: Re: c and m2
- Message-ID: <INFO-M2%93012715230787@UCF1VM.CC.UCF.EDU>
- Date: 27 Jan 93 20:15:03 GMT
- Sender: usenet@ucbvax.BERKELEY.EDU
- Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@uga.cc.uga.edu>
- Organization: The Internet
- Lines: 10
-
- The C compiler increments the pointer by the size of the base data type
- the pointer points to (e.g.: if you have "int *p" then the compiler knows
- that p points to integers, and "p++" generates the suitable code for
- pointing to the next integer in memory. In Modula-2 the expression would
- use TSIZE(ex), in your example. Without that method, address arithmetic
- increment/decrement is a machine dependent value typically equated to the
- size of the fundamental storage unit (whatever that might mean...).
- Of course, in proper languages, one addresses array elements using this
- wonderful new concept called a "subscript" instead of manipulating pointers
- like in assembly language ;-)
-