<?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[Frage zu C++ Funktions Aufbau]]></title><description><![CDATA[<p>Ich habe vor kurz zlib source code angeschaut, da sehe ich merkwürdige Funktion strukturaufbau, es lässt sich einwandfrei kompilieren.</p>
<p>normalerweise kenne ich funktion in c++ so</p>
<pre><code>int hello(int a, int b, int c)
{
   return 0;
}
</code></pre>
<p>aber hier ohne Datentyp in parameter, zuerst und dann lokale variable außerhalb von geschleifte Klammern. Ich verstehe unten nicht.</p>
<pre><code>uLong ZEXPORT adler32(adler, buf, len)
    uLong adler;
    const Bytef *buf;
    uInt len;
{
    unsigned long s1 = adler &amp; 0xffff;
    unsigned long s2 = (adler &gt;&gt; 16) &amp; 0xffff;
    int k;

    if (buf == Z_NULL) return 1L;

    while (len &gt; 0) {
        k = len &lt; NMAX ? len : NMAX;
        len -= k;
        while (k &gt;= 16) {
            DO16(buf);
	    buf += 16;
            k -= 16;
        }
        if (k != 0) do {
            s1 += *buf++;
	    s2 += s1;
        } while (--k);
        s1 %= BASE;
        s2 %= BASE;
    }
    return (s2 &lt;&lt; 16) | s1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/326936/frage-zu-c-funktions-aufbau</link><generator>RSS for Node</generator><lastBuildDate>Sun, 31 May 2026 11:58:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326936.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Jul 2014 08:19:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu C++ Funktions Aufbau on Tue, 15 Jul 2014 08:19:01 GMT]]></title><description><![CDATA[<p>Ich habe vor kurz zlib source code angeschaut, da sehe ich merkwürdige Funktion strukturaufbau, es lässt sich einwandfrei kompilieren.</p>
<p>normalerweise kenne ich funktion in c++ so</p>
<pre><code>int hello(int a, int b, int c)
{
   return 0;
}
</code></pre>
<p>aber hier ohne Datentyp in parameter, zuerst und dann lokale variable außerhalb von geschleifte Klammern. Ich verstehe unten nicht.</p>
<pre><code>uLong ZEXPORT adler32(adler, buf, len)
    uLong adler;
    const Bytef *buf;
    uInt len;
{
    unsigned long s1 = adler &amp; 0xffff;
    unsigned long s2 = (adler &gt;&gt; 16) &amp; 0xffff;
    int k;

    if (buf == Z_NULL) return 1L;

    while (len &gt; 0) {
        k = len &lt; NMAX ? len : NMAX;
        len -= k;
        while (k &gt;= 16) {
            DO16(buf);
	    buf += 16;
            k -= 16;
        }
        if (k != 0) do {
            s1 += *buf++;
	    s2 += s1;
        } while (--k);
        s1 %= BASE;
        s2 %= BASE;
    }
    return (s2 &lt;&lt; 16) | s1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2408665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408665</guid><dc:creator><![CDATA[CppSyntax]]></dc:creator><pubDate>Tue, 15 Jul 2014 08:19:01 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++ Funktions Aufbau on Tue, 15 Jul 2014 08:30:57 GMT]]></title><description><![CDATA[<p>Das ist die K&amp;R-Style Schreibweise.</p>
<pre><code>uLong ZEXPORT adler32(adler, buf, len)
    uLong adler;
    const Bytef *buf;
    uInt len;
</code></pre>
<p>In der Parameterliste sind nur die Namen, die Deklarationen der Namen finden darunter statt (und legen deren Typ fest).</p>
<p>Ist in C++ ill-formed, das wird dann also eine prähistorische C-Lib sein, denn schon laut C99 ist das deprecated.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408667</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 15 Jul 2014 08:30:57 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++ Funktions Aufbau on Tue, 15 Jul 2014 11:07:39 GMT]]></title><description><![CDATA[<p>Das ist schon ein bisschen schizophren, weil es in K&amp;R kein const gab <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408700</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 15 Jul 2014 11:07:39 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++ Funktions Aufbau on Tue, 15 Jul 2014 11:41:23 GMT]]></title><description><![CDATA[<p>Jepp, am Besten gar nicht erst angewöhnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408716</guid><dc:creator><![CDATA[oenone]]></dc:creator><pubDate>Tue, 15 Jul 2014 11:41:23 GMT</pubDate></item></channel></rss>