home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12908 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.0 KB  |  33 lines

  1. Path: sparky!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!bohra.cpg.oz.au!daavid
  2. From: daavid@bohra.cpg.oz.au (Daavid Turnbull)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why should POINTERS be so damn hard to understand ?
  5. Message-ID: <1992Aug28.120010.25748@bohra.cpg.oz.au>
  6. Date: 28 Aug 92 12:00:10 GMT
  7. References: <1992Aug26.183054.14146@newshub.ccs.yorku.ca> <l9nl34INNhln@almaak.usc.edu> <25233@castle.ed.ac.uk>
  8. Organization: Computer Power Software
  9. Lines: 22
  10.  
  11. In article <25233@castle.ed.ac.uk> chas@castle.ed.ac.uk (C Spencer) writes:
  12. >
  13. > Why does a pointer need to know what it's pointing to? Surely it's just
  14. > an address - if there was only one kind of pointer, there wouldn't be so
  15. > much to learn, and be confused by.
  16. ++ptr;    /* yields a different result if :- */
  17.  
  18. char *ptr;    /* as opposed to :- */
  19.  
  20. struct humungous *ptr;
  21. >
  22.  
  23. .... so what  happens when you do 
  24.  
  25. void *ptr;
  26.  
  27. ++ptr;    /* ? */
  28. -- 
  29.     Daavid Turnbull
  30.     daavid@bohra.cpg.oz   +61 3 823 0222    (fax) +61 3 824 8068
  31.     uunet!munnari!bohra.cpg.oz!daavid
  32.     CP Software Export Pty Ltd                   ACN 006 640 133
  33.