<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: 6.1 &#8212; Arrays (Part I)</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/</link>
	<description></description>
	<pubDate>Fri, 29 Aug 2008 19:20:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Sinni</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-21351</link>
		<dc:creator>Sinni</dc:creator>
		<pubDate>Sat, 19 Jul 2008 15:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-21351</guid>
		<description>int anTestScores[30]; // allocate 30 integers  &#124;&#124; anArray[3]; // allocate 3 integers  

If it starts counting at 0, shouldn't these instead read anTestScores[29]  and anArray[2] ?</description>
		<content:encoded><![CDATA[<p>int anTestScores[30]; // allocate 30 integers  || anArray[3]; // allocate 3 integers  </p>
<p>If it starts counting at 0, shouldn&#8217;t these instead read anTestScores[29]  and anArray[2] ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 5.8 &#8212; Break and continue</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-13471</link>
		<dc:creator>Learn C++ - &#187; 5.8 &#8212; Break and continue</dc:creator>
		<pubDate>Tue, 29 Apr 2008 04:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-13471</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 5.7 &#8212; For statements &#124; Home &#124; 6.1 &#8212; Arrays (Part I) &#187;     Tuesday, June 26th, 2007 at 4:22 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 5.7 &#8212; For statements | Home | 6.1 &#8212; Arrays (Part I) &raquo;     Tuesday, June 26th, 2007 at 4:22 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-10965</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 05 Apr 2008 04:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-10965</guid>
		<description>I'm not sure I understand your question.  What do you mean by an unknown number of elements?

It sounds to me like you're talking about arrays where the size isn't known in advance -- this is handled via dynamic allocation, and is covered in lesson 6.9.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I understand your question.  What do you mean by an unknown number of elements?</p>
<p>It sounds to me like you&#8217;re talking about arrays where the size isn&#8217;t known in advance &#8212; this is handled via dynamic allocation, and is covered in lesson 6.9.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: greensteepe</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-10939</link>
		<dc:creator>greensteepe</dc:creator>
		<pubDate>Fri, 04 Apr 2008 19:58:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-10939</guid>
		<description>thanks Alex!
Would you tell me about array with unknown number elements?
thank you so much!
</description>
		<content:encoded><![CDATA[<p>thanks Alex!<br />
Would you tell me about array with unknown number elements?<br />
thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmer</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-9139</link>
		<dc:creator>programmer</dc:creator>
		<pubDate>Sun, 09 Mar 2008 04:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-9139</guid>
		<description>thanks Alex

but I still get some confuse  .. could you please give an example like a complete program about what we could do with array .. 

thanks</description>
		<content:encoded><![CDATA[<p>thanks Alex</p>
<p>but I still get some confuse  .. could you please give an example like a complete program about what we could do with array .. </p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allen01</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8298</link>
		<dc:creator>Allen01</dc:creator>
		<pubDate>Thu, 21 Feb 2008 19:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8298</guid>
		<description>Thanks, it makes more sense now.</description>
		<content:encoded><![CDATA[<p>Thanks, it makes more sense now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8297</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 21 Feb 2008 18:49:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8297</guid>
		<description>nIndex is the assigned index value.  We set the value of nIndex on line 2 of your example.  The element value is what comes after the assignment on the third line.

To be as clear as possible: array indices must be integers.  You can use either a literal index:

&lt;pre&gt;
anArray[3] = 7;
&lt;/pre&gt;

or a variable index:

&lt;pre&gt;
int nIndex = 3;
anArray[nIndex] = 7;
&lt;/pre&gt;

nIndex doesn't have to be a constant integer.

Both of the above examples do the exact same thing: assign the value of 7 to array element 3.  When the statement anArray[nIndex] = 7 is evaluated, the array index part takes precedence and is evaluated first.  nIndex is evaluated to produce the value 3, and then anArray[3] = 7 assigns the value 7 to array element 3.

The index itself is just an integer -- thus, no need for [].  You only need the [] when you're accessing the array itself.</description>
		<content:encoded><![CDATA[<p>nIndex is the assigned index value.  We set the value of nIndex on line 2 of your example.  The element value is what comes after the assignment on the third line.</p>
<p>To be as clear as possible: array indices must be integers.  You can use either a literal index:</p>
<pre>
anArray[3] = 7;
</pre>
<p>or a variable index:</p>
<pre>
int nIndex = 3;
anArray[nIndex] = 7;
</pre>
<p>nIndex doesn&#8217;t have to be a constant integer.</p>
<p>Both of the above examples do the exact same thing: assign the value of 7 to array element 3.  When the statement anArray[nIndex] = 7 is evaluated, the array index part takes precedence and is evaluated first.  nIndex is evaluated to produce the value 3, and then anArray[3] = 7 assigns the value 7 to array element 3.</p>
<p>The index itself is just an integer &#8212; thus, no need for [].  You only need the [] when you&#8217;re accessing the array itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allen01</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8291</link>
		<dc:creator>Allen01</dc:creator>
		<pubDate>Thu, 21 Feb 2008 16:40:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-8291</guid>
		<description>Alex, not sure what is meant in this example, where array elements may be accessed by a non-constant integer variable; is "nIndex" the assigned index value, or is it an element value? I understand the first line and the last line seems to indicate that the value of 7 is being put into element nIndex. If so, should nIndex on line 2 be in [ ]?


&lt;PRE&gt;
int anArray[5];
int nIndex = 3;
anArray[nIndex] = 7;
&lt;/PRE&gt;</description>
		<content:encoded><![CDATA[<p>Alex, not sure what is meant in this example, where array elements may be accessed by a non-constant integer variable; is &#8220;nIndex&#8221; the assigned index value, or is it an element value? I understand the first line and the last line seems to indicate that the value of 7 is being put into element nIndex. If so, should nIndex on line 2 be in [ ]?</p>
<pre>
int anArray[5];
int nIndex = 3;
anArray[nIndex] = 7;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 10.4 -- Container classes</title>
		<link>http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-4404</link>
		<dc:creator>Learn C++ - &#187; 10.4 -- Container classes</dc:creator>
		<pubDate>Sat, 15 Dec 2007 00:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/61-arrays-part-i/#comment-4404</guid>
		<description>[...] and restrictions in their use. By far the most commonly used container in programming is the array, which you have already seen many examples of. Although C++ has built-in array functionality, [...]</description>
		<content:encoded><![CDATA[<p>[...] and restrictions in their use. By far the most commonly used container in programming is the array, which you have already seen many examples of. Although C++ has built-in array functionality, [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
