<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[variable Argumentenliste]]></title><description><![CDATA[<p>Ich möchte in einer Funktion eine unbestimmte Anzahl von Argumenten verarbeiten.</p>
<p>Dazu habe ich folgendes gefunden</p>
<pre><code class="language-cpp">int foo(int Anzahl, ...){/**/}

void main(void)
{
    foo(3, 0,1,2);
}
</code></pre>
<p>Das geht alles sehr schön. Nur möchte ich noch zusätzliche (vector) Parameter übergeben.<br />
Also</p>
<pre><code class="language-cpp">template&lt;typename T&gt;
int TForm1::foo(vector&lt;vector&lt;T&gt; &gt; *vec, int Anzahl, ...){/**/}
</code></pre>
<p>Das alleine kann auch so dastehen. Aber wenn ich die Funktion aufrufe</p>
<pre><code class="language-cpp">foo(&amp;vec, 3, 0, 1, 2);
</code></pre>
<p>gibts ne Fehlermeldung</p>
<p>[C++ Fehler] Unit1.cpp(43): E2285 Keine Übereinstimmung für 'TForm1::foo&lt;T&gt;(vector&lt;vector&lt;AnsiString,allocator&lt;AnsiString&gt; &gt;,allocator&lt;vector&lt;AnsiString,allocator&lt;AnsiString&gt; &gt; &gt; &gt; *,int,int,int,int)' gefunden</p>
<p>Plötzlich stört wohl der vector in der Argumentenliste. Warum.<br />
Was kann ich da machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148584/variable-argumentenliste</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 16:00:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148584.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 May 2006 14:20:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to variable Argumentenliste on Sun, 28 May 2006 19:12:50 GMT]]></title><description><![CDATA[<p>Ich möchte in einer Funktion eine unbestimmte Anzahl von Argumenten verarbeiten.</p>
<p>Dazu habe ich folgendes gefunden</p>
<pre><code class="language-cpp">int foo(int Anzahl, ...){/**/}

void main(void)
{
    foo(3, 0,1,2);
}
</code></pre>
<p>Das geht alles sehr schön. Nur möchte ich noch zusätzliche (vector) Parameter übergeben.<br />
Also</p>
<pre><code class="language-cpp">template&lt;typename T&gt;
int TForm1::foo(vector&lt;vector&lt;T&gt; &gt; *vec, int Anzahl, ...){/**/}
</code></pre>
<p>Das alleine kann auch so dastehen. Aber wenn ich die Funktion aufrufe</p>
<pre><code class="language-cpp">foo(&amp;vec, 3, 0, 1, 2);
</code></pre>
<p>gibts ne Fehlermeldung</p>
<p>[C++ Fehler] Unit1.cpp(43): E2285 Keine Übereinstimmung für 'TForm1::foo&lt;T&gt;(vector&lt;vector&lt;AnsiString,allocator&lt;AnsiString&gt; &gt;,allocator&lt;vector&lt;AnsiString,allocator&lt;AnsiString&gt; &gt; &gt; &gt; *,int,int,int,int)' gefunden</p>
<p>Plötzlich stört wohl der vector in der Argumentenliste. Warum.<br />
Was kann ich da machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066697</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Sun, 28 May 2006 19:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Sun, 28 May 2006 19:12:27 GMT]]></title><description><![CDATA[<p>Hab jetzt gemerkt, das es ohne</p>
<pre><code class="language-cpp">template&lt;typename T&gt;
int TForm1::foo(vector&lt;vector&lt;T&gt; &gt; *vec, int Anzahl, ...){/**/}
</code></pre>
<p>geht<br />
Der vector im Funtionsrumpf muss dann explizit als vector&lt;vector&lt;AnsiString&gt; &gt; *vec deklariert werden.</p>
<p>Ich hätte trotzdem noch ne Frage, gibt es eine Möglichkeit<br />
bei foo(int Anzahl, ...) die int Anzahl wegzulassen, also die Argumentenliste völlig dynamisch offen zu lassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066950</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Sun, 28 May 2006 19:12:27 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 04:31:41 GMT]]></title><description><![CDATA[<p>Nein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067056</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Mon, 29 May 2006 04:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 05:12:26 GMT]]></title><description><![CDATA[<p>Du könntest vereinbaren als letzten Parameter immer 0 zu übergeben.</p>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067060</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 29 May 2006 05:12:26 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 08:25:12 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Du könntest vereinbaren als letzten Parameter immer 0 zu übergeben.</p>
<p>Greetz, Swordfish</p>
</blockquote>
<p>Und dann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067150</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067150</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Mon, 29 May 2006 08:25:12 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 08:40:41 GMT]]></title><description><![CDATA[<p>Naja, dann kanste alle Parameter abarbeiten, bis du irgendwann beim wert 0 ankommst und weißt das Schluss ist!?</p>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067162</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 29 May 2006 08:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 08:45:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/6994">@Trulli</a><br />
Warum nimmst du statt der variablen Argumentliste nicht einen vector&lt;int&gt;. Dann kannst du beliebige Größen verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067164</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 29 May 2006 08:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Mon, 29 May 2006 19:45:45 GMT]]></title><description><![CDATA[<p>Weil ich nicht so machen will..</p>
<pre><code class="language-cpp">vector&lt;int&gt; inti;
inti blablabla...
foo(Arg, inti)
</code></pre>
<p>sondern</p>
<pre><code class="language-cpp">foo(Arg, bla, bla 2,4);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1067657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067657</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Mon, 29 May 2006 19:45:45 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Tue, 30 May 2006 04:51:48 GMT]]></title><description><![CDATA[<p>1. in C/C++ gibt es keine variablen Argumentlisten (höchstens Vorbelegungen)</p>
<p>2. Wenn du keinen Zeiger oder vec oder stuct oder anderen &quot;Container&quot; nutzen willst / kannst, muss es dabei bleiben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067765</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Tue, 30 May 2006 04:51:48 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Tue, 30 May 2006 08:10:21 GMT]]></title><description><![CDATA[<p>Christian211 schrieb:</p>
<blockquote>
<p>1. in C/C++ gibt es keine variablen Argumentlisten (höchstens Vorbelegungen)</p>
</blockquote>
<p>Das ist falsch. Sieh mal in den Standard 8.3.5 und dort besonders Abschnitt 2.<br />
Ausschnitt daraus</p>
<blockquote>
<p>If the parameter declaration clause terminates with an ellipsis, the number of arguments shall be equal to or greater than the number of parameters specified. Where syntactically correct, “, ...” is synonymous with “...”. [Example: the declaration<br />
int printf(const char*, ...);<br />
declares a function that can be called with varying numbers and types of arguments.<br />
printf(&quot;hello world&quot;);<br />
printf(&quot;a=%d b=%d&quot;, a, b);<br />
However, the first argument must be of a type that can be converted to a const char*. ] [Note: the standard header &lt;cstdarg&gt; contains a mechanism for accessing arguments passed using the ellipsis (see 5.2.2 and 18.7). ]</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1067839</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067839</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 30 May 2006 08:10:21 GMT</pubDate></item><item><title><![CDATA[Reply to variable Argumentenliste on Tue, 30 May 2006 08:36:11 GMT]]></title><description><![CDATA[<p>Das muss ich heute abend mal ausprobieren. War mir neu. Habe ich auch noch in keiner Doku gesehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067855</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Tue, 30 May 2006 08:36:11 GMT</pubDate></item></channel></rss>