[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



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>