<?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: 7.14 &#8212; Ellipses (and why to avoid them)</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/</link>
	<description></description>
	<pubDate>Wed, 20 Aug 2008 08:49:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Learn C++ - &#187; 7.13 &#8212; Command line arguments</title>
		<link>http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-13498</link>
		<dc:creator>Learn C++ - &#187; 7.13 &#8212; Command line arguments</dc:creator>
		<pubDate>Tue, 29 Apr 2008 05:08:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-13498</guid>
		<description>[...]  &#171; 12.6 &#8212; Pure virtual functions, abstract base classes, and interface classes &#124; Home &#124; 7.14 &#8212; Ellipses (and why to avoid them) &#187;     Friday, February 15th, 2008 at 4:06 [...]</description>
		<content:encoded><![CDATA[<p>[...]  &laquo; 12.6 &#8212; Pure virtual functions, abstract base classes, and interface classes | Home | 7.14 &#8212; Ellipses (and why to avoid them) &raquo;     Friday, February 15th, 2008 at 4:06 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-10293</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 24 Mar 2008 22:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-10293</guid>
		<description>My understanding (and I may be wrong about this) is that the implemention of va_start() and va_args() is left up to the compiler.  If that's actually the case, then va_end() could do any necessary cleanup.

I looked at how va_end() was implemented in Microsoft Visual Studio and this is how it is defined:

&lt;pre&gt;
#define va_end(ap) ap = (va_list)0
&lt;/pre&gt;

As you can see, it's actually a macro function that just sets the ap parameter to 0.  So, at least with Microsoft Visual Studio, there's no real practical effect of calling va_end(), outside of maybe NULLing your list in case you inadvertently try to use it again without calling va_start().

In your example, you'd have to pass list into va_end(), but va_start() should cause the list to start at the beginning of the ellipses again -- so yes, nX would be the first element of the ellipses.</description>
		<content:encoded><![CDATA[<p>My understanding (and I may be wrong about this) is that the implemention of va_start() and va_args() is left up to the compiler.  If that&#8217;s actually the case, then va_end() could do any necessary cleanup.</p>
<p>I looked at how va_end() was implemented in Microsoft Visual Studio and this is how it is defined:</p>
<pre>
#define va_end(ap) ap = (va_list)0
</pre>
<p>As you can see, it&#8217;s actually a macro function that just sets the ap parameter to 0.  So, at least with Microsoft Visual Studio, there&#8217;s no real practical effect of calling va_end(), outside of maybe NULLing your list in case you inadvertently try to use it again without calling va_start().</p>
<p>In your example, you&#8217;d have to pass list into va_end(), but va_start() should cause the list to start at the beginning of the ellipses again &#8212; so yes, nX would be the first element of the ellipses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-10274</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 24 Mar 2008 17:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/#comment-10274</guid>
		<description>Hello Alex -

Interesting. Could you elaborate on what is meant by:

"Finally, to clean up when we are done, we call va_end(), with va_list as the parameter." ??

What does va_end() actually do, does it just reset the pointer into the list to the default value? (Wouldn't that be the same as resetting the pointer va_list to 0? Or, is there more to it?) What is the practical effect of calling va_end()? If we reference the list pointed to by va_list after calling va_end(), do we just get the first element in the ellipses again?

For example:
&lt;pre&gt;
va_end();
va_start(list, nCount);
int nX = va_arg(list, int);
&lt;/pre&gt;
Would that set nX equal to the first element of the ellipses?</description>
		<content:encoded><![CDATA[<p>Hello Alex -</p>
<p>Interesting. Could you elaborate on what is meant by:</p>
<p>&#8220;Finally, to clean up when we are done, we call va_end(), with va_list as the parameter.&#8221; ??</p>
<p>What does va_end() actually do, does it just reset the pointer into the list to the default value? (Wouldn&#8217;t that be the same as resetting the pointer va_list to 0? Or, is there more to it?) What is the practical effect of calling va_end()? If we reference the list pointed to by va_list after calling va_end(), do we just get the first element in the ellipses again?</p>
<p>For example:</p>
<pre>
va_end();
va_start(list, nCount);
int nX = va_arg(list, int);
</pre>
<p>Would that set nX equal to the first element of the ellipses?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
