home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula2 / 1756 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

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