Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > [OT] pointer vs. index notation

Reply
Thread Tools

[OT] pointer vs. index notation

 
 
CBFalconer
Guest
Posts: n/a
 
      11-12-2007
Johannes Bauer wrote:
> santosh schrieb:
>

.... snip ...
>>
>> It has been mentioned that the pointer notation leads to slightly
>> more efficient code generation, but I suppose compilers these days
>> generate the same code for both the forms.

>
> I do not know how *any* compiler could dereference an integer value
> (as the i[p] notation suggests).


A reference of that type is converted into a pointer (the p) and an
integer (the i). As long as there is one of each the results can
be added and then dereferenced (assuming within range). Note that
the integer is multiplied by (sizof *p).

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Infix notation to postfix notation Tameem C Programming 454 01-31-2014 06:01 PM
sorting index-15, index-9, index-110 "the human way"? Tomasz Chmielewski Perl Misc 4 03-04-2008 05:01 PM
Hungarian Notation Vs. Pascal Notation? Grey Squirrel ASP .Net 6 03-21-2007 09:42 AM
How do I write this in pointer notation? Angela C++ 3 10-27-2003 02:14 AM
Dot notation V Bracket notation Robert Mark Bram Javascript 3 07-05-2003 03:59 AM



Advertisments