<?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[Interessantes Phänomen bei sizeof]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

struct g
{
    short t;
    char k;      
};

struct g2
{
    int t;
    int k;      
};

int main(int argc, char *argv[])
{
    cout &lt;&lt; sizeof(short) + sizeof(char) &lt;&lt; endl; //3
    cout &lt;&lt; sizeof(g) &lt;&lt; endl; //4 &lt;- WIESO ?!
    cout &lt;&lt; sizeof(g2) &lt;&lt; endl; //8 &lt;- Das stimmt...

    system(&quot;PAUSE&quot;);
    return 0;
}
</code></pre>
<p>Das verstehe ich einfach nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /><br />
Vlt könnt ihr es ja erklären...</p>
<p>Gruß Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203868/interessantes-phänomen-bei-sizeof</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 01:54:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203868.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Jan 2008 17:05:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Interessantes Phänomen bei sizeof on Sun, 27 Jan 2008 17:05:01 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

struct g
{
    short t;
    char k;      
};

struct g2
{
    int t;
    int k;      
};

int main(int argc, char *argv[])
{
    cout &lt;&lt; sizeof(short) + sizeof(char) &lt;&lt; endl; //3
    cout &lt;&lt; sizeof(g) &lt;&lt; endl; //4 &lt;- WIESO ?!
    cout &lt;&lt; sizeof(g2) &lt;&lt; endl; //8 &lt;- Das stimmt...

    system(&quot;PAUSE&quot;);
    return 0;
}
</code></pre>
<p>Das verstehe ich einfach nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /><br />
Vlt könnt ihr es ja erklären...</p>
<p>Gruß Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1444612</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1444612</guid><dc:creator><![CDATA[Foxx90]]></dc:creator><pubDate>Sun, 27 Jan 2008 17:05:01 GMT</pubDate></item><item><title><![CDATA[Reply to Interessantes Phänomen bei sizeof on Sun, 27 Jan 2008 17:07:55 GMT]]></title><description><![CDATA[<p><a href="https://www.google.de/search?&amp;q=struct%20padding%20c%2B%2B" rel="nofollow">Google: struct padding c++</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1444615</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1444615</guid><dc:creator><![CDATA[Nachrichtentext:]]></dc:creator><pubDate>Sun, 27 Jan 2008 17:07:55 GMT</pubDate></item><item><title><![CDATA[Reply to Interessantes Phänomen bei sizeof on Sun, 27 Jan 2008 17:10:47 GMT]]></title><description><![CDATA[<p>allse klar danke..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1444616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1444616</guid><dc:creator><![CDATA[Foxx90]]></dc:creator><pubDate>Sun, 27 Jan 2008 17:10:47 GMT</pubDate></item></channel></rss>