<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; array reference</title>
	<atom:link href="http://weseetips.com/tag/array-reference/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to Pass Array by Reference?</title>
		<link>http://weseetips.com/2009/03/15/how-to-pass-array-by-reference/</link>
		<comments>http://weseetips.com/2009/03/15/how-to-pass-array-by-reference/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 10:44:55 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Codeproject]]></category>
		<category><![CDATA[array by ref]]></category>
		<category><![CDATA[array by reference]]></category>
		<category><![CDATA[array reference]]></category>
		<category><![CDATA[error C2234]]></category>
		<category><![CDATA[error C2234: '' : arrays of references are illegal]]></category>
		<category><![CDATA[pass array by ref]]></category>
		<category><![CDATA[pass array by reference]]></category>

		<guid isPermaLink="false">http://weseetips.com/?p=940</guid>
		<description><![CDATA[We used to use arrays, a lot. But did you ever tried how to pass array by reference to another function? Yes. Its a bit tricky. Receiving arrays by reference have special syntax. The arrayname and &#38; symbol should be enclosed in parenthesis. And you should specify the size of array. Have a look at [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" title="Icon Description" src="http://weseetips.files.wordpress.com/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /><br />
We used to use arrays, a lot. But did you ever tried <span style="color:#0000ff;">how to pass array by reference </span>to another function? Yes. Its a bit tricky.</p>
<p><img class="alignnone size-full wp-image-941" title="arraybyreference" src="http://siteground205.com/~weseetip/wp-content/uploads/2009/03/arraybyreference.jpg" alt="arraybyreference" width="500" height="471" /></p>
<p><img class="alignnone size-medium wp-image-12" title="Icon How Can I Do It?" src="http://weseetips.files.wordpress.com/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
Receiving arrays by reference have special syntax. The <span style="color:#0000ff;"><strong>arrayname</strong> </span>and<span style="color:#0000ff;"> <strong>&amp;</strong></span> symbol <span style="color:#0000ff;">should be enclosed in parenthesis.</span> And <span style="color:#0000ff;">you should specify the size of array</span>. Have a look at the following code snippet.</p>
<pre>// Receive Array by reference.
void GetArray( int (&amp;Array) [10] )
{
}

// Test array by reference.
void CRabbitDlgDlg::TestArray()
{
    // Pass array by reference.
    int Array[10] = { 0 };
    GetArray( Array );
}</pre>
<p><img class="alignnone size-medium wp-image-18" title="Icon Note" src="http://weseetips.files.wordpress.com/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
Indeed, you can pass the array as pointer and then use it. But if you ever need to pass an array by reference, then remember this tip.</p>
<p><img class="alignnone size-medium wp-image-51" title="beginnerseries" src="http://weseetips.files.wordpress.com/2008/03/beginnerseries.jpg?w=215" alt="" width="215" height="32" /><br />
Targeted Audience &#8211; Beginners.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2009/03/15/how-to-pass-array-by-reference/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

