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