<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 7.7 &#8212; Default parameters</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/77-default-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Sep 2010 10:51:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dave</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-71307</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Fri, 30 Oct 2009 12:50:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-71307</guid>
		<description>I must say this site is awesome and clean looking..specially how the code is displayed....looks neat! keep up good work and i am doing last min craming when i googled default params...so wish me luck! :)</description>
		<content:encoded><![CDATA[<p>I must say this site is awesome and clean looking..specially how the code is displayed&#8230;.looks neat! keep up good work and i am doing last min craming when i googled default params&#8230;so wish me luck! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshuman</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-71288</link>
		<dc:creator>Anshuman</dc:creator>
		<pubDate>Fri, 30 Oct 2009 07:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-71288</guid>
		<description>you must not use specify the default value both in function prototype and definition

&lt;pre&gt;
void printvalues(int nvalue1, int nvalue2)
{

cout&lt;&lt;&quot;1st : &quot;&lt;&lt; nvalue1&lt;&lt; endl;
cout&lt;&lt;&quot;2st : &quot;&lt;&lt; nvalue2&lt;&lt; endl;

}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>you must not use specify the default value both in function prototype and definition</p>
<pre>
void printvalues(int nvalue1, int nvalue2)
{

cout&lt;&lt;&quot;1st : &quot;&lt;&lt; nvalue1&lt;&lt; endl;
cout&lt;&lt;&quot;2st : &quot;&lt;&lt; nvalue2&lt;&lt; endl;

}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: simon1122</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-68970</link>
		<dc:creator>simon1122</dc:creator>
		<pubDate>Thu, 24 Sep 2009 18:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-68970</guid>
		<description>hi

can any one tell me what is wrong with this one??

thak you</description>
		<content:encoded><![CDATA[<p>hi</p>
<p>can any one tell me what is wrong with this one??</p>
<p>thak you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simon1122</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-68969</link>
		<dc:creator>simon1122</dc:creator>
		<pubDate>Thu, 24 Sep 2009 18:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-68969</guid>
		<description>//Function
#include
 using namespace std;
 
 
  void printvalues(int nvalue1, int nvalue2=10 );
  



 int main()
 {
 
printvalues(1);
printvalues(1,3);

/*scaffolding code for testing purpose*/
 cin.ignore(256, &#039;\n&#039;);
 cout&lt;&lt; &quot;press Enter to continue..&quot; &lt;&lt; endl;
 cin.get();

return 0;
}


void printvalues(int nvalue1, int nvalue2 = 10 )
{
    
     cout&lt;&lt;&quot;1st  : &quot;&lt;&lt; nvalue1&lt;&lt; endl;
     cout&lt;&lt;&quot;2st  : &quot;&lt;&lt; nvalue2&lt;&lt; endl;
     
     }</description>
		<content:encoded><![CDATA[<p>//Function<br />
#include<br />
 using namespace std;</p>
<p>  void printvalues(int nvalue1, int nvalue2=10 );</p>
<p> int main()<br />
 {</p>
<p>printvalues(1);<br />
printvalues(1,3);</p>
<p>/*scaffolding code for testing purpose*/<br />
 cin.ignore(256, &#8216;\n&#8217;);<br />
 cout&lt;&lt; &quot;press Enter to continue..&quot; &lt;&lt; endl;<br />
 cin.get();</p>
<p>return 0;<br />
}</p>
<p>void printvalues(int nvalue1, int nvalue2 = 10 )<br />
{</p>
<p>     cout&lt;&lt;&quot;1st  : &quot;&lt;&lt; nvalue1&lt;&lt; endl;<br />
     cout&lt;&lt;&quot;2st  : &quot;&lt;&lt; nvalue2&lt;&lt; endl;</p>
<p>     }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ericc</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-68701</link>
		<dc:creator>Ericc</dc:creator>
		<pubDate>Sun, 20 Sep 2009 14:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-68701</guid>
		<description>u forgot ; in the Prototype</description>
		<content:encoded><![CDATA[<p>u forgot ; in the Prototype</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-33851</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 06 Dec 2008 19:49:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-33851</guid>
		<description>I just added a lesson on &lt;a href=&quot;http://www.learncpp.com/cpp-tutorial/59-random-number-generation/&quot; rel=&quot;nofollow&quot;&gt;random number generation&lt;/a&gt;. :)</description>
		<content:encoded><![CDATA[<p>I just added a lesson on <a href="http://www.learncpp.com/cpp-tutorial/59-random-number-generation/" rel="nofollow">random number generation</a>. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pathik</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-33718</link>
		<dc:creator>Pathik</dc:creator>
		<pubDate>Fri, 05 Dec 2008 00:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-33718</guid>
		<description>how do you get a random value in C++?
For example :
&lt;pre&gt;
int main()
{
	using namespace std;
	int y = 25; // I want y to be a random number below 100
	int x;
	
try_again:
	do
	{
		cout &lt;&lt; &quot;Enter a value below 100: &quot;;
		cin &gt;&gt; x;
	}while (x &gt; 100);
	
	if (x &lt; y)
	{
		cout &lt;&lt; &quot;Too small&quot; &lt;&lt; endl;
		goto try_again;
	}
	if (x &gt; y)
	{
		cout &lt;&lt; &quot;Too big&quot; &lt;&lt; endl;
		goto try_again;
	}
	if (x == y)
	{
		cout &lt;&lt; &quot;WOW!! You Got it!&quot; &lt;&lt; endl;
	}
	return 0;
}
&lt;/pre&gt;

You see, I want y to be a random number when program starts up.</description>
		<content:encoded><![CDATA[<p>how do you get a random value in C++?<br />
For example :</p>
<pre>
int main()
{
	using namespace std;
	int y = 25; // I want y to be a random number below 100
	int x;

try_again:
	do
	{
		cout &lt;&lt; &quot;Enter a value below 100: &quot;;
		cin &gt;&gt; x;
	}while (x &gt; 100);

	if (x &lt; y)
	{
		cout &lt;&lt; &quot;Too small&quot; &lt;&lt; endl;
		goto try_again;
	}
	if (x &gt; y)
	{
		cout &lt;&lt; &quot;Too big&quot; &lt;&lt; endl;
		goto try_again;
	}
	if (x == y)
	{
		cout &lt;&lt; &quot;WOW!! You Got it!&quot; &lt;&lt; endl;
	}
	return 0;
}
</pre>
<p>You see, I want y to be a random number when program starts up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 7.8 &#8212; Function Pointers</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-21668</link>
		<dc:creator>Learn C++ - &#187; 7.8 &#8212; Function Pointers</dc:creator>
		<pubDate>Thu, 24 Jul 2008 01:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-21668</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 7.7 &#8212; Default parameters &#124; Home &#124; 7.9 &#8212; The stack and the heap &#187;     Wednesday, August 8th, 2007 at 4:52 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 7.7 &#8212; Default parameters | Home | 7.9 &#8212; The stack and the heap &raquo;     Wednesday, August 8th, 2007 at 4:52 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 7.6 &#8212; Function overloading</title>
		<link>http://www.learncpp.com/cpp-tutorial/77-default-parameters/comment-page-1/#comment-13492</link>
		<dc:creator>Learn C++ - &#187; 7.6 &#8212; Function overloading</dc:creator>
		<pubDate>Tue, 29 Apr 2008 05:03:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/77-default-parameters/#comment-13492</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 7.5 &#8212; Inline functions &#124; Home &#124; 7.7 &#8212; Default parameters &#187;     Friday, August 3rd, 2007 at 8:25 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 7.5 &#8212; Inline functions | Home | 7.7 &#8212; Default parameters &raquo;     Friday, August 3rd, 2007 at 8:25 [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
