<?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++-Standard bzgl. Typgröße und Overflow]]></title><description><![CDATA[<p>Hallo, ich habe 2 kurze Fragen zum C++ - Standard.<br />
1.) In C ist der Overflow von signed Integern ja undefiniert (oder implententation defined?). Ist das in C++ auch so?<br />
2.) Schreibt der Standard die Größen der POD's vor? ich weis nur, dass char &lt;= short &lt;= int &lt;= long ( &lt;= long long ) gelten muss. Aber werden auch Mindestgrößen vorgeschrieben? Konnte im Standard irgendwie nix dazu finden (unser Vorlesungsskript behauptet nämlich, dass char immer 8 bit, short immer 16 bit, int immer 32 bit und long immer 64 bit hat. Aber ich glaube, dass das falsch ist (auch wenn es vielleicht üblich ist)).</p>
<p>Schonmal Danke für Antworten <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/topic/289669/frage-zu-c-standard-bzgl-typgröße-und-overflow</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 00:58:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/289669.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Jul 2011 15:13:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 15:13:08 GMT]]></title><description><![CDATA[<p>Hallo, ich habe 2 kurze Fragen zum C++ - Standard.<br />
1.) In C ist der Overflow von signed Integern ja undefiniert (oder implententation defined?). Ist das in C++ auch so?<br />
2.) Schreibt der Standard die Größen der POD's vor? ich weis nur, dass char &lt;= short &lt;= int &lt;= long ( &lt;= long long ) gelten muss. Aber werden auch Mindestgrößen vorgeschrieben? Konnte im Standard irgendwie nix dazu finden (unser Vorlesungsskript behauptet nämlich, dass char immer 8 bit, short immer 16 bit, int immer 32 bit und long immer 64 bit hat. Aber ich glaube, dass das falsch ist (auch wenn es vielleicht üblich ist)).</p>
<p>Schonmal Danke für Antworten <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/2091014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091014</guid><dc:creator><![CDATA[StandardFrage]]></dc:creator><pubDate>Sun, 10 Jul 2011 15:13:08 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 15:17:42 GMT]]></title><description><![CDATA[<p>1.- was heisst undefiniert? wenn du zu gross wirst, wirds ganz klein - und umgekehrt. halt bitarithmetik</p>
<p>2.- soweit ich weiss schreibt der der standard nichts vonw egen den größen vor ausser halt was du da geschrieben hast. vllt noch, dass char 8 bit sind, aber dass int == 32 ist ist schon sofort auf 64bit systemen falsch !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091015</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091015</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sun, 10 Jul 2011 15:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 15:29:51 GMT]]></title><description><![CDATA[<p>StandardFrage schrieb:</p>
<blockquote>
<p>Hallo, ich habe 2 kurze Fragen zum C++ - Standard.<br />
1.) In C ist der Overflow von signed Integern ja undefiniert (oder implententation defined?). Ist das in C++ auch so?</p>
</blockquote>
<p>Ja, ist undefiniert.</p>
<blockquote>
<p>2.) Schreibt der Standard die Größen der POD's vor? ich weis nur, dass char &lt;= short &lt;= int &lt;= long ( &lt;= long long ) gelten muss. Aber werden auch Mindestgrößen vorgeschrieben? Konnte im Standard irgendwie nix dazu finden (unser Vorlesungsskript behauptet nämlich, dass char immer 8 bit, short immer 16 bit, int immer 32 bit und long immer 64 bit hat. Aber ich glaube, dass das falsch ist (auch wenn es vielleicht üblich ist)).</p>
</blockquote>
<p>Die Mindestgrößen sind die gleichen wie in C:<br />
<a href="http://en.wikipedia.org/wiki/Limits.h" rel="nofollow">http://en.wikipedia.org/wiki/Limits.h</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091018</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 10 Jul 2011 15:29:51 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 15:56:54 GMT]]></title><description><![CDATA[<p>[quote=&quot;StandardFrage&quot;]Schreibt der Standard die Größen der POD's vor?/quote]<br />
PODs sind nochmal ne ganz andere Baustelle als die eingebauten Datentypen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091028</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Sun, 10 Jul 2011 15:56:54 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 16:15:09 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>dass char 8 bit sind</p>
</blockquote>
<p>Falsch! Ein <code>char</code> ist exakt so gross wie die kleinste adressierbare Einheit des Systems (also Byte). Wieviele Bits ein Byte hat, hat C++ nicht zu entscheiden.</p>
<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>int == 32 ist ist schon sofort auf 64bit systemen falsch !</p>
</blockquote>
<p>Du verwechselst da etwas. Die Integergrösse hat nichts mit der Zeigergrösse gemeinsam.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091040</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Sun, 10 Jul 2011 16:15:09 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 16:30:42 GMT]]></title><description><![CDATA[<p>?</p>
<p>also sind die zeiger bei einem 64 bit system auch 8 byte ?<br />
ok wäre sinnvoll und logisch, da man ja auf einem 32 bit system nur 4gb ram addressieren kann...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091048</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sun, 10 Jul 2011 16:30:42 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 16:36:51 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>also sind die zeiger bei einem 64 bit system auch 8 byte ?</p>
</blockquote>
<p>Ja. Und mit der Grösse eines Integers hat das nichts zu tun!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091052</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Sun, 10 Jul 2011 16:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 16:51:53 GMT]]></title><description><![CDATA[<p>Danke SeppJ. Genau das wollte ich wissen <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/2091059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091059</guid><dc:creator><![CDATA[StandardFrage]]></dc:creator><pubDate>Sun, 10 Jul 2011 16:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 19:29:49 GMT]]></title><description><![CDATA[<p>EOutOfResources schrieb:</p>
<blockquote>
<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>dass char 8 bit sind</p>
</blockquote>
<p>Falsch! Ein <code>char</code> ist exakt so gross wie die kleinste adressierbare Einheit des Systems (also Byte). Wieviele Bits ein Byte hat, hat C++ nicht zu entscheiden.</p>
</blockquote>
<p>Doch... Mindestens 8 Bit...</p>
<p>EDIT: Also bei meinem nächsten Beitrag droht ein Overflow ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2091119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091119</guid><dc:creator><![CDATA[XSpille]]></dc:creator><pubDate>Sun, 10 Jul 2011 19:29:49 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu C++-Standard bzgl. Typgröße und Overflow on Sun, 10 Jul 2011 19:43:50 GMT]]></title><description><![CDATA[<p>XSpille schrieb:</p>
<blockquote>
<p>Doch... Mindestens 8 Bit...</p>
</blockquote>
<p>*nachschau*<br />
Hast recht. So sieht's gemäss C++03 aus:</p>
<blockquote>
<p>1 ≡ <code>sizeof(char)</code> ≤ <code>sizeof(short)</code> ≤ <code>sizeof(int)</code> ≤ <code>sizeof(long)</code><br />
1 ≡ <code>sizeof(bool)</code> ≤ <code>sizeof(long)</code><br />
<code>sizeof(char)</code> ≤ <code>sizeof(wchar_t)</code> ≤ <code>sizeof(long)</code><br />
<code>sizeof(float)</code> ≤ <code>sizeof(double)</code> ≤ <code>sizeof(long double)</code><br />
<code>sizeof(N)</code> ≡ <code>sizeof(signed N)</code> ≡ <code>sizeof(unsigned N)</code><br />
<code>char</code> hat ≥ 8 Bits.<br />
<code>short</code> hat ≥ 16 Bits.<br />
<code>long</code> hat ≥ 32 Bits.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2091122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2091122</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Sun, 10 Jul 2011 19:43:50 GMT</pubDate></item></channel></rss>