[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu Feb 12 10:55:33 2004 -->
- <!--x-from-r13: rfbgrevp ng 3gvzrf25.arg (Urbsserl) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected]-a-geek.com --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] This is legal C: -->
- <li><em>date</em>: Thu Feb 12 10:55:33 2004</li>
- <li><em>from</em>: esoteric at 3times25.net (Geoffrey)</li>
- <li><em>in-reply-to</em>: <<a href="msg00434.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00434.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] This is legal C:</li>
In C, j[foo] is the same as *(j + foo). foo alone is the address of the
beginning of the array foo[]. When you add an int to an address, you
actually are doing pointer math, thus you're saying give me the 2 entry
in the array foo[]. That is:
take the address of the beginning of the array: foo
add 2 to it to give me the address of the 3rd item in the array (0,1,2)
The * says, give me the value found at that address point, which happens
to be the string "heck" in the array.
--
Until later, Geoffrey Registered Linux User #108567
Building secure systems inspite of Microsoft
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00434" href="msg00434.html">[ale] This is legal C:</a></strong>
<ul><li><em>From:</em> bjorn at sccs.swarthmore.edu (Bjorn Dittmer-Roche)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00434.html">[ale] This is legal C:</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00436.html">[ale] This is legal C:</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00434.html">[ale] This is legal C:</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00436.html">[ale] This is legal C:</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00435"><strong>Date</strong></a></li>
<li><a href="threads.html#00435"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>