<?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[struct &amp;quot;zu gross&amp;quot;?]]></title><description><![CDATA[<p>Ich habe folgenden struct:</p>
<pre><code class="language-cpp">#pragma pack(push, 1)
	struct SPDHeader
	{
		unsigned short	Handle; //(2Byte)
		unsigned short	rMax; //(4Byte)
		unsigned short	cMax; //(6Byte)
		unsigned short	nPages; //(8Byte)
		unsigned short	el_Size; //(10Byte)
		char		Bezeichnung[36]; //(46Byte)
		char		Mnemo[6]; //(52Byte)
		char		SigTyp[2]; //(54Byte)
		double		Skal0; //(62Byte)
		double		Skal1; //(70Byte)
		char		Dim[10]; //(80Byte)
		double		MaxVal; //(88Byte)
		double		MinVal; //(96Byte)
		unsigned short	Mask; //(98Byte)
		char		ParSign[2]; //(100Byte)
		char		DMODE[3]; //(103Byte)
		bool		gueltig; //(104Byte)
		unsigned short	Status; //(106Byte)
		unsigned short	Anzahl_Plaetze; //(108Byte)
		unsigned short	Plaetze[32]; //(110Byte)
		unsigned short	F_Pointer_Adr; //(112Byte)
		unsigned short	F_Bel_Adr; //(114Byte)
		char		F_Pointer_mnemo[6]; //(120Byte)
		char		F_Bel_mnemo[6]; //(126Byte)
		char		Station[6]; //(132Byte)
		char		Store[6]; //(138Byte)
		char		HangUp[6]; //(144Byte)
		unsigned short	Verarbeitung; //(146Byte)
		unsigned int	MaxIndex; //(150Byte)
		unsigned int	Next; //(154Byte)
		char		Dummy[296]; //(450Byte)
	};
</code></pre>
<p>Mittels</p>
<pre><code>sizeof(SPDHeader)
</code></pre>
<p>erhalte ich eine größe von 512 Byte, was auch so sein soll. Addiere ich aber die Datentypen manuell zusammen, kommt eine größe von nur 450 Byte raus. Was ist mit den restlichen 62 Byte?</p>
<p>Gruß Vanish</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223815/struct-quot-zu-gross-quot</link><generator>RSS for Node</generator><lastBuildDate>Sat, 03 Oct 2026 12:53:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223815.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Oct 2008 11:55:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to struct &amp;quot;zu gross&amp;quot;? on Wed, 01 Oct 2008 11:55:49 GMT]]></title><description><![CDATA[<p>Ich habe folgenden struct:</p>
<pre><code class="language-cpp">#pragma pack(push, 1)
	struct SPDHeader
	{
		unsigned short	Handle; //(2Byte)
		unsigned short	rMax; //(4Byte)
		unsigned short	cMax; //(6Byte)
		unsigned short	nPages; //(8Byte)
		unsigned short	el_Size; //(10Byte)
		char		Bezeichnung[36]; //(46Byte)
		char		Mnemo[6]; //(52Byte)
		char		SigTyp[2]; //(54Byte)
		double		Skal0; //(62Byte)
		double		Skal1; //(70Byte)
		char		Dim[10]; //(80Byte)
		double		MaxVal; //(88Byte)
		double		MinVal; //(96Byte)
		unsigned short	Mask; //(98Byte)
		char		ParSign[2]; //(100Byte)
		char		DMODE[3]; //(103Byte)
		bool		gueltig; //(104Byte)
		unsigned short	Status; //(106Byte)
		unsigned short	Anzahl_Plaetze; //(108Byte)
		unsigned short	Plaetze[32]; //(110Byte)
		unsigned short	F_Pointer_Adr; //(112Byte)
		unsigned short	F_Bel_Adr; //(114Byte)
		char		F_Pointer_mnemo[6]; //(120Byte)
		char		F_Bel_mnemo[6]; //(126Byte)
		char		Station[6]; //(132Byte)
		char		Store[6]; //(138Byte)
		char		HangUp[6]; //(144Byte)
		unsigned short	Verarbeitung; //(146Byte)
		unsigned int	MaxIndex; //(150Byte)
		unsigned int	Next; //(154Byte)
		char		Dummy[296]; //(450Byte)
	};
</code></pre>
<p>Mittels</p>
<pre><code>sizeof(SPDHeader)
</code></pre>
<p>erhalte ich eine größe von 512 Byte, was auch so sein soll. Addiere ich aber die Datentypen manuell zusammen, kommt eine größe von nur 450 Byte raus. Was ist mit den restlichen 62 Byte?</p>
<p>Gruß Vanish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591442</guid><dc:creator><![CDATA[VanishOxiAction]]></dc:creator><pubDate>Wed, 01 Oct 2008 11:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to struct &amp;quot;zu gross&amp;quot;? on Wed, 01 Oct 2008 12:12:07 GMT]]></title><description><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Speicherausrichtung" rel="nofollow">Wikipedia -&gt; Alignment</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591448</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Wed, 01 Oct 2008 12:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to struct &amp;quot;zu gross&amp;quot;? on Wed, 01 Oct 2008 12:04:46 GMT]]></title><description><![CDATA[<p>Häufig werden die Member nach bestimmten Adressen ausgerichtet, um möglichst effizienten Zugriff zu gewähren (Alignment). Meistens entspricht diese Adressgrösse dem grössten Member. Wenn die Grösse der Struktur nicht als benutzter Platz, sondern als Differenz der letzten und ersten Adresse angesehen wird, kann sie schon grösser sein.</p>
<p>Man kann die automatische Ausrichtung aber glaube ich ausschalten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591451</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 01 Oct 2008 12:04:46 GMT</pubDate></item><item><title><![CDATA[Reply to struct &amp;quot;zu gross&amp;quot;? on Wed, 01 Oct 2008 12:49:12 GMT]]></title><description><![CDATA[<p>Hmm ich dachte durch</p>
<blockquote>
<p>#pragma pack(push, 1)</p>
</blockquote>
<p>wird direkt an den Bytegrenzen ausgerichtet.</p>
<p>Aber egal, jetzt habe ich die Speicherausrichtung verstanden <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="🙂"
    /><br />
Danke!</p>
<p>Gruß Vanish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591477</guid><dc:creator><![CDATA[VanishOxiAction]]></dc:creator><pubDate>Wed, 01 Oct 2008 12:49:12 GMT</pubDate></item><item><title><![CDATA[Reply to struct &amp;quot;zu gross&amp;quot;? on Thu, 02 Oct 2008 08:06:55 GMT]]></title><description><![CDATA[<p>Du hast auch 62 Bytes unterschlagen bei &quot;unsigned short Plaetze[32]&quot;...<br />
und dann paßt auch die Direktive &quot;#pragma pack(push, 1)&quot; (es stimmt, daß damit auf jedes Byte aligned wird).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591903</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Thu, 02 Oct 2008 08:06:55 GMT</pubDate></item></channel></rss>