<?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[int ( *t(int) )( int* );]]></title><description><![CDATA[<p>Hi,</p>
<p>habe diese deklaration auf <a href="http://www.gotw.ca/gotw/046.htm" rel="nofollow">http://www.gotw.ca/gotw/046.htm</a> gesehen.<br />
Herb Sutter:<br />
...this is a function declaration, for a function named &quot;t&quot; that takes an int and returns a pointer to a function that takes an int* and returns an int.<br />
Kann das nicht nachvollziehen. wäre das nicht</p>
<pre><code class="language-cpp">int (*)(int*)  t(int)
</code></pre>
<p>?</p>
<p>rekursive deklaration? ein beispiel für c++'s vexing parsing?</p>
<p>Der VS compiler parst es zu</p>
<pre><code class="language-cpp">int(*(*t)(int*))(int)
</code></pre>
<p>Hat jemand gedanken dazu? danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/234209/int-t-int-int</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 11:55:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/234209.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Feb 2009 18:13:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Sat, 14 Feb 2009 18:13:05 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>habe diese deklaration auf <a href="http://www.gotw.ca/gotw/046.htm" rel="nofollow">http://www.gotw.ca/gotw/046.htm</a> gesehen.<br />
Herb Sutter:<br />
...this is a function declaration, for a function named &quot;t&quot; that takes an int and returns a pointer to a function that takes an int* and returns an int.<br />
Kann das nicht nachvollziehen. wäre das nicht</p>
<pre><code class="language-cpp">int (*)(int*)  t(int)
</code></pre>
<p>?</p>
<p>rekursive deklaration? ein beispiel für c++'s vexing parsing?</p>
<p>Der VS compiler parst es zu</p>
<pre><code class="language-cpp">int(*(*t)(int*))(int)
</code></pre>
<p>Hat jemand gedanken dazu? danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1663881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1663881</guid><dc:creator><![CDATA[new benutzer;]]></dc:creator><pubDate>Sat, 14 Feb 2009 18:13:05 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Sun, 15 Feb 2009 15:47:17 GMT]]></title><description><![CDATA[<p>Klammern Setzung beachten</p>
<p>int (<em>)(int</em>) t(int)</p>
<p>Hier hast du keine sinnvollen Klammern gesetzt, ergo ist es ein syntax fehler.</p>
<p>Du kannst nicht einfach alles aneinanderreihen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> das klappt so nicht. Zerlege das Konstrukt einfach:</p>
<p>int ( <em>(int) )( int</em> );</p>
<p>nehmen wir die innerste Klammer:<br />
(int)<br />
ok, das sagt uns noch nicht viel, gehen wir einen schritt weiter:<br />
*(int)<br />
aha, ein zeiger auf eine funktion die einen int erwartet, gehen wir nun weiter:</p>
<p>int (<em>(int))(int</em>)<br />
ok, das ist jetzt kompliziert - tun wir mal so als wuerde die funktion nur einen int returnen und keinen funktionszeiger:</p>
<p>int (<em>(int))<br />
ah, schoener.<br />
wir sehen nun dass alles um unseren zeiger herum der return typ ist, ergo ist der return typ:<br />
int (</em>)(int*)</p>
<p>ein Funktionszeiger der einen int* nimmt und einen int returned.</p>
<p>Das &quot;dumme&quot; an funktionszeigern ist, dass sie beide seiten vom typennamen mit informationen fuellen.<br />
ein &quot;int i;&quot; ist ja simpel: alle informationen ueber i stehen links davon.<br />
bei &quot;int f(int);&quot; stehen aber links und rechts informationen.</p>
<p>und genau darum geht es in dem gotw ja: typedefs sind praktische helfer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1664256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664256</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Sun, 15 Feb 2009 15:47:17 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Sun, 15 Feb 2009 18:00:05 GMT]]></title><description><![CDATA[<p>Vielen Dank. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Man könnte auch argumentieren, da es schlußendlich eine funktions(nicht funktionspointer)definition ist, daß auch (int (<em>)(int</em>)) t(int) valide sein sollte, zumal dies mit typedef funtioniert.</p>
<p>P.S. Wie würde eine</p>
<p>...function declaration, for a function named &quot;t&quot; that takes an int and returns a pointer to a function that takes an int* and returns a(n) (not int, but) pointer to a function that takes an int* and returns an int...</p>
<p>aussehen? int (<em>(int (*u(int))(int*)))(int</em>) geht nicht. nicht verschachtelbar? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1664346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664346</guid><dc:creator><![CDATA[new benutzer;]]></dc:creator><pubDate>Sun, 15 Feb 2009 18:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Sun, 15 Feb 2009 22:27:47 GMT]]></title><description><![CDATA[<p>new benutzer; schrieb:</p>
<blockquote>
<p>...function declaration, for a function named &quot;t&quot; that takes an int and returns a pointer to a function that takes an int* and returns a(n) (not int, but) pointer to a function that takes an int* and returns an int...</p>
<p>aussehen? int (<em>(int (*u(int))(int*)))(int</em>) geht nicht. nicht verschachtelbar? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<pre><code class="language-cpp">int (*(*t(int))(int*))(int*)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1664457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664457</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sun, 15 Feb 2009 22:27:47 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Mon, 16 Feb 2009 02:24:47 GMT]]></title><description><![CDATA[<p>ah ja. sorry. bei VS leider</p>
<pre><code>error C2091: Funktionsergebnis ist eine Funktion
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1664489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664489</guid><dc:creator><![CDATA[new benutzer;]]></dc:creator><pubDate>Mon, 16 Feb 2009 02:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Mon, 16 Feb 2009 07:06:57 GMT]]></title><description><![CDATA[<p>gcc schluckt das. Falsch abgeschrieben, irgendwo einen Stern vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1664500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664500</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 16 Feb 2009 07:06:57 GMT</pubDate></item><item><title><![CDATA[Reply to int ( *t(int) )( int* ); on Mon, 16 Feb 2009 08:18:45 GMT]]></title><description><![CDATA[<p>Stern vergessen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1664525</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1664525</guid><dc:creator><![CDATA[new benutzer;]]></dc:creator><pubDate>Mon, 16 Feb 2009 08:18:45 GMT</pubDate></item></channel></rss>