<?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[char array ende?]]></title><description><![CDATA[<p>Ich schreib grad einen MS3D Loader in C++.<br />
Doch hab ich beim Header ein Problem.</p>
<p>Einlesen tu ich so:</p>
<pre><code class="language-cpp">[...]

    // Allocate memory:
	char* buffer = new char [length];

	// Read data as a block:
	is.read (buffer, length);
	is.close();

	// Read header
	MS3DHeader* header = (MS3DHeader*)buffer

	MessageBox(NULL, header-&gt;id, &quot;&quot;, MB_OK); // test

	if (strcmp(header-&gt;id, &quot;MS3D000000&quot;) != 0)
		return false;
</code></pre>
<p>Mein Header struct ist auch korrekt laut Dateispezifikation. Es ist ein char[10], der immer &quot;MS3D000000&quot; ist. Auf jeden Fall ist das Problem, dass strcmp sagt, dass die beiden nicht gleich sind.<br />
In der MessageBox steht folgendes:<br />
<a href="http://bloody-blades.de/images/messageBox.png" rel="nofollow">http://bloody-blades.de/images/messageBox.png</a></p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162865/char-array-ende</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 19:04:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162865.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Oct 2006 21:20:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to char array ende? on Mon, 23 Oct 2006 21:20:07 GMT]]></title><description><![CDATA[<p>Ich schreib grad einen MS3D Loader in C++.<br />
Doch hab ich beim Header ein Problem.</p>
<p>Einlesen tu ich so:</p>
<pre><code class="language-cpp">[...]

    // Allocate memory:
	char* buffer = new char [length];

	// Read data as a block:
	is.read (buffer, length);
	is.close();

	// Read header
	MS3DHeader* header = (MS3DHeader*)buffer

	MessageBox(NULL, header-&gt;id, &quot;&quot;, MB_OK); // test

	if (strcmp(header-&gt;id, &quot;MS3D000000&quot;) != 0)
		return false;
</code></pre>
<p>Mein Header struct ist auch korrekt laut Dateispezifikation. Es ist ein char[10], der immer &quot;MS3D000000&quot; ist. Auf jeden Fall ist das Problem, dass strcmp sagt, dass die beiden nicht gleich sind.<br />
In der MessageBox steht folgendes:<br />
<a href="http://bloody-blades.de/images/messageBox.png" rel="nofollow">http://bloody-blades.de/images/messageBox.png</a></p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1159963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1159963</guid><dc:creator><![CDATA[xindon]]></dc:creator><pubDate>Mon, 23 Oct 2006 21:20:07 GMT</pubDate></item><item><title><![CDATA[Reply to char array ende? on Mon, 23 Oct 2006 21:37:45 GMT]]></title><description><![CDATA[<p><em>header-&gt;id</em> ist nicht Null-terminiert.</p>
<pre><code class="language-cpp">if (strncmp(header-&gt;id, &quot;MS3D000000&quot;, 10) != 0)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1159969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1159969</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Mon, 23 Oct 2006 21:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to char array ende? on Mon, 23 Oct 2006 21:43:49 GMT]]></title><description><![CDATA[<p>Ah, wunderbar <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="🙂"
    /> Sowas hab ich mir auch schon gedacht, aber ich kannte die andere compare Funktion noch nicht, vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1159971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1159971</guid><dc:creator><![CDATA[xindon]]></dc:creator><pubDate>Mon, 23 Oct 2006 21:43:49 GMT</pubDate></item></channel></rss>