<?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[static const array in Klasse]]></title><description><![CDATA[<p>Warum meckert der compiler, wenn ich dieses hier versuche:</p>
<pre><code>class xy
{

...

static const float ioXPosition[3] = { -0.5, -0.5, 2.5 };

...

}
</code></pre>
<p>Der Fehler unter VC9 schaut dann so aus:</p>
<p>error C2059: Syntaxfehler: '{'<br />
error C2334: Unerwartete(s) Token vor '{'; sicht barer Funktionstext wird übersprungen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/273548/static-const-array-in-klasse</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 01:14:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/273548.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Sep 2010 22:06:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to static const array in Klasse on Wed, 08 Sep 2010 22:06:50 GMT]]></title><description><![CDATA[<p>Warum meckert der compiler, wenn ich dieses hier versuche:</p>
<pre><code>class xy
{

...

static const float ioXPosition[3] = { -0.5, -0.5, 2.5 };

...

}
</code></pre>
<p>Der Fehler unter VC9 schaut dann so aus:</p>
<p>error C2059: Syntaxfehler: '{'<br />
error C2334: Unerwartete(s) Token vor '{'; sicht barer Funktionstext wird übersprungen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1950010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1950010</guid><dc:creator><![CDATA[Osbios]]></dc:creator><pubDate>Wed, 08 Sep 2010 22:06:50 GMT</pubDate></item><item><title><![CDATA[Reply to static const array in Klasse on Wed, 08 Sep 2010 22:24:56 GMT]]></title><description><![CDATA[<p>Du musst statische Objekte außerhalb der Klassendeklaration noch einmal definieren. Und im Falle einer Konstante gehört die Initialisierung natürlich an die gleiche Stelle. Die meisten Compiler haben eine Ausnahme und erlauben was du versuchst für primitive Datentypen, deswegen ist die dies bisher vielleicht noch nicht aufgefallen. Bei einem Array geht das dann aber nicht mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1950016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1950016</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 08 Sep 2010 22:24:56 GMT</pubDate></item><item><title><![CDATA[Reply to static const array in Klasse on Thu, 09 Sep 2010 08:12:51 GMT]]></title><description><![CDATA[<p>thx, das wars.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1950092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1950092</guid><dc:creator><![CDATA[Osbios]]></dc:creator><pubDate>Thu, 09 Sep 2010 08:12:51 GMT</pubDate></item></channel></rss>