home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!sunic!kth.se!news.kth.se!RICHARD
- From: RICHARD@CLYDE.ttt.kth.se
- Subject: Re: Why should POINTERS be so damn hard to understand ?
- In-Reply-To: barmar@think.com's message of 27 Aug 1992 15:34:19 GMT
- Message-ID: <RICHARD.92Aug27193319@CLYDE.ttt.kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: clyde.ttt.kth.se
- Organization: Department of TeleTransmission Theory
- References: <l9nl34INNhln@almaak.usc.edu> <25233@castle.ed.ac.uk>
- <1992Aug27.135946.6622@infonode.ingr.com>
- <17islrINNh6c@early-bird.think.com>
- Date: Thu, 27 Aug 1992 18:33:19 GMT
- Lines: 23
-
- In article <17islrINNh6c@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
-
- This was an example of a tight loop with "untyped pointers":
-
- int a[1000];
- char *_i;
-
- for (_i=(char *)a; _i<a+1000*sizeof(int); _i+=sizeof(int))
- *(int *)_i = whatever();
-
- I would epect this to produce almost identical code. And in a language
- where pointers weren't typed, you wouldn't need all the casting.
-
- Of course, and in C, as you HAVE typed pointers, you wouldn't need either
- type casts OR sizeof!
-
- --
- !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
- ! Richard Levitte, System manager ! tel: int+46-8-790 64 23 !
- ! Royal Institute of Technology ! fax: int+46-8-791 76 54 !
- ! Department of Teletransmition Theory ! Internet: richard@ttt.kth.se !
- ! S-100 44 Stockholm, Sweden ! !
- !---------------------------------------------------------------------------!
-