<?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[A foo; oder A foo();?]]></title><description><![CDATA[<p>Öhm ja, am besten mache ich es kurz: Gibt es einen Unterschied ob man die Klammern dort hinschreibt oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188060/a-foo-oder-a-foo</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 00:28:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188060.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Jul 2007 17:55:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to A foo; oder A foo();? on Thu, 26 Jul 2007 17:55:12 GMT]]></title><description><![CDATA[<p>Öhm ja, am besten mache ich es kurz: Gibt es einen Unterschied ob man die Klammern dort hinschreibt oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1333254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1333254</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Thu, 26 Jul 2007 17:55:12 GMT</pubDate></item><item><title><![CDATA[Reply to A foo; oder A foo();? on Thu, 26 Jul 2007 18:09:20 GMT]]></title><description><![CDATA[<p>The-Kenny schrieb:</p>
<blockquote>
<p>Öhm ja, am besten mache ich es kurz: Gibt es einen Unterschied ob man die Klammern dort hinschreibt oder nicht?</p>
</blockquote>
<p>Wie Dir ein kurzer Test hätte bestätigen können: ja. Ersteres definiert eine Variable, zweiteres deklariert eine Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1333267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1333267</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Thu, 26 Jul 2007 18:09:20 GMT</pubDate></item><item><title><![CDATA[Reply to A foo; oder A foo();? on Thu, 26 Jul 2007 18:25:28 GMT]]></title><description><![CDATA[<p>Konrad Rudolph schrieb:</p>
<blockquote>
<p>The-Kenny schrieb:</p>
<blockquote>
<p>Öhm ja, am besten mache ich es kurz: Gibt es einen Unterschied ob man die Klammern dort hinschreibt oder nicht?</p>
</blockquote>
<p>Wie Dir ein kurzer Test hätte bestätigen können: ja. Ersteres definiert eine Variable, zweiteres deklariert eine Funktion.</p>
</blockquote>
<p>Hm ne, das ist mir schon klar^^ Ich hab mich wohl etwas undeutlich ausgedrückt.</p>
<p>Ich meinte nicht die Funktionsdeklaration, sondern die Definition einer Variable eines eigenen Typs:</p>
<pre><code class="language-cpp">struct blubb
{
    void set();
};

int main()
{
    blubb a;
    a.set();

    blubb b();
    b.set();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1333283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1333283</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Thu, 26 Jul 2007 18:25:28 GMT</pubDate></item><item><title><![CDATA[Reply to A foo; oder A foo();? on Thu, 26 Jul 2007 18:31:47 GMT]]></title><description><![CDATA[<p>The-Kenny schrieb:</p>
<blockquote>
<p>Ich meinte nicht die Funktionsdeklaration, sondern die Definition einer Variable eines eigenen Typs:</p>
</blockquote>
<p>Es *ist* in jedem Fall eine Funktionsdeklaration. Der C++-Compiler &quot;argumentiert&quot; folgendermaßen:</p>
<p>- Die Definition ist a priori doppeldeutig, denn es könnte einerseits eine Variablendefinition gemeint sein (+ Default-Konstruktur-Aufruf) oder eben eine parameterlose Funktionsdefinition mit Rückgabetyp.<br />
- Diese Doppeldeutigkeit wird *immer* zugunsten der Funktion aufgelöst.</p>
<p>Mit anderen Worten: *wenn* etwas – rein lexikalisch – eine Funktionsdeklaration sein *könnte* dann *ist* es auch eine. Daher ist 'a b();' *immer* eine Funktionsdeklaration, egal, was 'a' und 'b' für Bezeichner sind.</p>
<p>/EDIT: Und dass Dein Beispielcode fehlerhaft ist (weil der Compiler sich beschwert, '.set' könne nicht auf eine Funktion angewendet werden), sollte Dir ein einfacher Test eigentlich zeigen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1333285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1333285</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Thu, 26 Jul 2007 18:31:47 GMT</pubDate></item><item><title><![CDATA[Reply to A foo; oder A foo();? on Thu, 26 Jul 2007 18:58:11 GMT]]></title><description><![CDATA[<p>Hm... stimmt.</p>
<p>Naja, wieder was gelernt, außerdem verstehe ich jetzt was der Fehler mir sagen will *g*</p>
<p>Danke^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1333296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1333296</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Thu, 26 Jul 2007 18:58:11 GMT</pubDate></item></channel></rss>