<?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 - problem]]></title><description><![CDATA[<p>N'Abend<br />
Ich habe mir nen Struct zusammengestellt, das eben Daten aufnimmt. Dann erstelle ich mir davon ein Derivat aber als Array. Also:</p>
<pre><code class="language-cpp">struct KEYS
{
    HKEY hRoot;
    char *szPath;
    char *szName;
    char *szValue;
};

KEYS cdkey[7];
</code></pre>
<p>Wenn ich jetzt jedoch versuche diese Derivate zu füllen, kommt immer, dass cdkey bereits deklariert wurde bzw. schon wieder deklariert wird:</p>
<pre><code class="language-cpp">cdkey[0].hRoot = HKEY_LOCAL_MACHINE;
cdkey[0].szPath = &quot;...&quot;;
cdkey[0].szName = &quot;...&quot;;
cdkey[0].szValue = &quot;&quot;;

cdkey[1].hRoot = HKEY_LOCAL_MACHINE;
cdkey[1].szPath = &quot;...&quot;;
cdkey[1].szName = &quot;...&quot;;
cdkey[1].szValue = &quot;&quot;;
.
.
.
</code></pre>
<p>Ich verstehe absolut nicht warum. Ich habe alle Header includiert und auch sonst auf eigentlich alles geachtet. Ich hatte mit structs bisher nie Probleme, bis eben jetzt.</p>
<p>DIV Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187451/struct-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 15:28:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187451.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Jul 2007 17:43:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 17:43:44 GMT]]></title><description><![CDATA[<p>N'Abend<br />
Ich habe mir nen Struct zusammengestellt, das eben Daten aufnimmt. Dann erstelle ich mir davon ein Derivat aber als Array. Also:</p>
<pre><code class="language-cpp">struct KEYS
{
    HKEY hRoot;
    char *szPath;
    char *szName;
    char *szValue;
};

KEYS cdkey[7];
</code></pre>
<p>Wenn ich jetzt jedoch versuche diese Derivate zu füllen, kommt immer, dass cdkey bereits deklariert wurde bzw. schon wieder deklariert wird:</p>
<pre><code class="language-cpp">cdkey[0].hRoot = HKEY_LOCAL_MACHINE;
cdkey[0].szPath = &quot;...&quot;;
cdkey[0].szName = &quot;...&quot;;
cdkey[0].szValue = &quot;&quot;;

cdkey[1].hRoot = HKEY_LOCAL_MACHINE;
cdkey[1].szPath = &quot;...&quot;;
cdkey[1].szName = &quot;...&quot;;
cdkey[1].szValue = &quot;&quot;;
.
.
.
</code></pre>
<p>Ich verstehe absolut nicht warum. Ich habe alle Header includiert und auch sonst auf eigentlich alles geachtet. Ich hatte mit structs bisher nie Probleme, bis eben jetzt.</p>
<p>DIV Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328772</guid><dc:creator><![CDATA[Ominion|off]]></dc:creator><pubDate>Thu, 19 Jul 2007 17:43:44 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 17:58:30 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Dein gezeigter Codeauschnitt ist soweit in Ordnung. Die Fehlermeldung steht in Zusammmenhang mit anderen Codeteilen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328785</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 19 Jul 2007 17:58:30 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 18:01:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">cdkey[0].hRoot = HKEY_LOCAL_MACHINE;
cdkey[0].szPath = &quot;...&quot;;
cdkey[0].szName = &quot;...&quot;;
cdkey[0].szValue = &quot;&quot;;

cdkey[1].hRoot = HKEY_LOCAL_MACHINE;
cdkey[1].szPath = &quot;...&quot;;
cdkey[1].szName = &quot;...&quot;;
cdkey[1].szValue = &quot;&quot;;
</code></pre>
<p>Ich hoffe, du versuchst obenstehendes nicht global?</p>
<p>Vielleicht ist das der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328788</guid><dc:creator><![CDATA[Paul Panther]]></dc:creator><pubDate>Thu, 19 Jul 2007 18:01:22 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 18:07:28 GMT]]></title><description><![CDATA[<p>du wirst wohl recht haben, ich hatte das immer vor main() deklariert. jetzt habe ich es in main reingeschoben -&gt; es geht...find ich nur eigenartig, weil wenn ich &quot;früher&quot; einen struct/class angelegt habe, und gleich danach außerhalb von main() ein paar derivate gebildet habe, hatter er nie ein problem...</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328792</guid><dc:creator><![CDATA[Ominion|off]]></dc:creator><pubDate>Thu, 19 Jul 2007 18:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 18:08:18 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/903">@Paul</a> Panther: naja, wie gesagt hatte ich gemacht, war aber vorher nie ein Problem...</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328793</guid><dc:creator><![CDATA[Ominion|off]]></dc:creator><pubDate>Thu, 19 Jul 2007 18:08:18 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 18:18:09 GMT]]></title><description><![CDATA[<p>Ominion|off schrieb:</p>
<blockquote>
<p>du wirst wohl recht haben, ich hatte das immer vor main() deklariert. jetzt habe ich es in main reingeschoben -&gt; es geht...find ich nur eigenartig, weil wenn ich &quot;früher&quot; einen struct/class angelegt habe, und gleich danach außerhalb von main() ein paar derivate gebildet habe, hatter er nie ein problem...</p>
</blockquote>
<p>Meines Wissens nach darf man im globalen Bereich nur definieren oder deklarieren, kann aber auch sein, dass ich mich irre, oder dass frühere Compiler auch Zuweisungen im globalen Bereich zugelassen haben...</p>
<p>Die einzige Möglichkeit die mir noch einfallen würde, dass du die entsprechenden Variabeln auch im globalen Bereich belegen kannst, wäre dann wohl über eine Initialisierungsliste, also:</p>
<pre><code class="language-cpp">KEYS cdkey[7] = { {HKEY_LOCAL_MACHINE, &quot;...&quot;, &quot;...&quot;, &quot;&quot;}, {HKEY_LOCAL_MACHINE, [...] } };
</code></pre>
<p>Aber auf jeden fall schön, dass ich helfen konnte...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328798</guid><dc:creator><![CDATA[Paul Panther]]></dc:creator><pubDate>Thu, 19 Jul 2007 18:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to struct - problem on Thu, 19 Jul 2007 18:25:20 GMT]]></title><description><![CDATA[<p>ich glaube bei mir trifft dann eher das mit dem alten compiler zu...habe erst vor einiger zeit gewechselt, seitdem aber keine structs oder classes gebraucht.<br />
ihr konntet beide helfen...deshalb: danke an euch beide.</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1328807</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1328807</guid><dc:creator><![CDATA[Ominion|off]]></dc:creator><pubDate>Thu, 19 Jul 2007 18:25:20 GMT</pubDate></item></channel></rss>