<?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[Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden]]></title><description><![CDATA[<p>Hi,<br />
habe ein Problem.<br />
Möchte ein Programm erstellen, das einen kleinen String vorließt.<br />
Abgesehen davon, dass noch der ein oder andere Logikfehler drin ist, meckert der Compiler:</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: sprecher2, Konfiguration: Debug Win32 ------<br />
1&gt;Kompilieren...<br />
1&gt;sprecher2.cpp<br />
1&gt;.\sprecher2.cpp(17) : error C2228: Links von &quot;.find&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist 'char [60]'<br />
1&gt;.\sprecher2.cpp(22) : error C2228: Links von &quot;.substr&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist 'char [60]'<br />
1&gt;Das Buildprotokoll wurde unter &quot;file://c:\Users\XXX\Documents\Visual Studio 2008\Projects\training\funktionen1\sprecher2\sprecher2\Debug\BuildLog.htm&quot; gespeichert.<br />
1&gt;sprecher2 - 2 Fehler, 0 Warnung(en)<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
<p>Der Quelltext sieht so aus:</p>
<pre><code>#include &quot;stdafx.h&quot;
#undef UNICODE

#include &lt;windows.h&gt;
#include &lt;cstring&gt;
#include &lt;iostream&gt;

#pragma comment(lib,&quot;winmm.lib&quot;) //nur bei vs-c++
// habe ich (intelfan) so vom i-net kopiert

int main(void)
{
	char text[60] = &quot;hallo toll&quot;;

	// leerzeichen finden
	int leerzeichen;
	leerzeichen = text.find(&quot; &quot;, 0);

	// wort finden
	char wort[60];
	wort = text.substr(0, leerzeichen);

	char datei[30];

	strncpy( datei, wort, sizeof(datei)-1 );
	strncat( datei, &quot;.wav&quot;, 1 );

	std::cout &lt;&lt; datei;

	sndPlaySound(datei, SND_SYNC);

}
</code></pre>
<p>Meine IDE ist Visual C++ 2008 Express Edition.<br />
Was mache ich falsch? find und substr gehören doch zu cstring, genauso sieht es aus, wenn ich string einbinde anstatt cstring.<br />
Hoffe ihr könnt mir helfen, die Letzten 2 Fehler zu beseitigen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
danke schonmal im vorraus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/232243/compiler-muss-sich-eine-klasse-struktur-union-befinden</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 10:54:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232243.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Jan 2009 17:05:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Sat, 14 Feb 2009 13:18:55 GMT]]></title><description><![CDATA[<p>Hi,<br />
habe ein Problem.<br />
Möchte ein Programm erstellen, das einen kleinen String vorließt.<br />
Abgesehen davon, dass noch der ein oder andere Logikfehler drin ist, meckert der Compiler:</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: sprecher2, Konfiguration: Debug Win32 ------<br />
1&gt;Kompilieren...<br />
1&gt;sprecher2.cpp<br />
1&gt;.\sprecher2.cpp(17) : error C2228: Links von &quot;.find&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist 'char [60]'<br />
1&gt;.\sprecher2.cpp(22) : error C2228: Links von &quot;.substr&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist 'char [60]'<br />
1&gt;Das Buildprotokoll wurde unter &quot;file://c:\Users\XXX\Documents\Visual Studio 2008\Projects\training\funktionen1\sprecher2\sprecher2\Debug\BuildLog.htm&quot; gespeichert.<br />
1&gt;sprecher2 - 2 Fehler, 0 Warnung(en)<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
<p>Der Quelltext sieht so aus:</p>
<pre><code>#include &quot;stdafx.h&quot;
#undef UNICODE

#include &lt;windows.h&gt;
#include &lt;cstring&gt;
#include &lt;iostream&gt;

#pragma comment(lib,&quot;winmm.lib&quot;) //nur bei vs-c++
// habe ich (intelfan) so vom i-net kopiert

int main(void)
{
	char text[60] = &quot;hallo toll&quot;;

	// leerzeichen finden
	int leerzeichen;
	leerzeichen = text.find(&quot; &quot;, 0);

	// wort finden
	char wort[60];
	wort = text.substr(0, leerzeichen);

	char datei[30];

	strncpy( datei, wort, sizeof(datei)-1 );
	strncat( datei, &quot;.wav&quot;, 1 );

	std::cout &lt;&lt; datei;

	sndPlaySound(datei, SND_SYNC);

}
</code></pre>
<p>Meine IDE ist Visual C++ 2008 Express Edition.<br />
Was mache ich falsch? find und substr gehören doch zu cstring, genauso sieht es aus, wenn ich string einbinde anstatt cstring.<br />
Hoffe ihr könnt mir helfen, die Letzten 2 Fehler zu beseitigen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
danke schonmal im vorraus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649043</guid><dc:creator><![CDATA[intelfan]]></dc:creator><pubDate>Sat, 14 Feb 2009 13:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:10:40 GMT]]></title><description><![CDATA[<p>find und substr sind Memberfunktionen der Klasse std::string. text hat aber den Typ char[60].</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649047</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:10:40 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:19:36 GMT]]></title><description><![CDATA[<p>Danke für die blitzschnelle Antwort!</p>
<p>Wenn ich dich richtig verstanden habe, meinst du das so:</p>
<blockquote>
<p>std::leerzeichen = text.find(&quot; &quot;, 0);</p>
<p>// wort finden<br />
char wort[60];<br />
std::wort = text.substr(0, leerzeichen);</p>
</blockquote>
<p>Dann bekomme ich jedoch 4 Fehlermeldungen, u.a.:<br />
error C2039: 'leerzeichen': Ist kein Element von 'std'</p>
<p>Wenn ich es falsch verstanden habe, korrigiere mich bitte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649051</guid><dc:creator><![CDATA[intelfan]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:19:36 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:24:49 GMT]]></title><description><![CDATA[<p><code>std::leerzeichen</code> und <code>std::wort</code> ? Die wären mir aber nicht bekannt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<pre><code class="language-cpp">std::string text = &quot;hallo toll&quot;;
std::string wort;
</code></pre>
<p>Und das <code>char</code> -Array brauchst du nämlich gar nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649056</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:24:49 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:25:27 GMT]]></title><description><![CDATA[<p>Ich meinte, dass du <code>text</code> den Typ <code>std::string</code> geben sollst:</p>
<pre><code class="language-cpp">std::string text = &quot;Hallo toll&quot;;
leerzeichen = text.find(&quot; &quot;, 0);
...
</code></pre>
<p>Wenn du nicht weißt, was std::string ist, woher weißt du dann, dass es find und substr gibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649059</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:25:27 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Sat, 14 Feb 2009 13:20:33 GMT]]></title><description><![CDATA[<p>Ok, ich habe es soweit nun verstanden.<br />
Dann kommt jedoch das Problem, dass ich Strings und Chars vermische.</p>
<p>Also habe ich mich dafür entschieden nur mit Strings zu arbeiten:</p>
<pre><code>#include &quot;stdafx.h&quot;
#undef UNICODE

#include &lt;windows.h&gt;
#include &lt;cstring&gt;
#include &lt;iostream&gt;

#pragma comment(lib,&quot;winmm.lib&quot;) //nur bei vs-c++

int main(void)
{
	std::string = &quot;hallo toll&quot;;

	// leerzeichen finden
	int leerzeichen;
	leerzeichen = text.find(&quot; &quot;, 0);

	// wort finden
	std::string wort;
	wort = text.substr(0, leerzeichen);

	std::string datei = wort;

	//strncpy( datei, wort, sizeof(datei)-1 );
	//strncat( datei, &quot;.wav&quot;, 1 );

	datei += &quot;.wav&quot;;

	std::cout &lt;&lt; datei;

	sndPlaySound(datei, SND_SYNC);

}
</code></pre>
<p>Soweit, so gut. Dennoch kommen 7 Fehler:</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: sprecher3, Konfiguration: Debug Win32 ------<br />
1&gt;Kompilieren...<br />
1&gt;sprecher3.cpp<br />
1&gt;.\sprecher3.cpp(13) : error C2513: 'std::basic_string&lt;_Elem,_Traits,_Ax&gt;': Keine Variable vor '=' deklariert<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;,<br />
1&gt; _Ax=std::allocator&lt;char&gt;<br />
1&gt; ]<br />
1&gt;.\sprecher3.cpp(17) : error C2065: 'text': nichtdeklarierter Bezeichner<br />
1&gt;.\sprecher3.cpp(17) : error C2228: Links von &quot;.find&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist ''unknown-type''<br />
1&gt;.\sprecher3.cpp(22) : error C2065: 'text': nichtdeklarierter Bezeichner<br />
1&gt;.\sprecher3.cpp(22) : error C2228: Links von &quot;.substr&quot; muss sich eine Klasse/Struktur/Union befinden.<br />
1&gt; Typ ist ''unknown-type''<br />
1&gt;.\sprecher3.cpp(32) : error C2679: Binärer Operator '&lt;&lt;': Es konnte kein Operator gefunden werden, der einen rechtsseitigen Operanden vom Typ 'std::string' akzeptiert (oder keine geeignete Konvertierung möglich)<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(653): kann 'std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;char,std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,const char *)' sein [bei der Verwendung der argumentbezogenen Suche gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(700): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;char,std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,char)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(738): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,const char *)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(785): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,char)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(909): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,const signed char *)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(916): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,signed char)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(923): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,const unsigned char *)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(930): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::operator &lt;&lt;&lt;std::char_traits&lt;char&gt;&gt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;,unsigned char)&quot; [bei argumentbezogenem Lookup gefunden]<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(170): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;(__cdecl *)(std::basic_ostream&lt;_Elem,_Traits&gt; &amp;))&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(176): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(std::basic_ios&lt;_Elem,_Traits&gt; &amp;(__cdecl *)(std::basic_ios&lt;_Elem,_Traits&gt; &amp;))&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(183): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(std::ios_base &amp;(__cdecl *)(std::ios_base &amp;))&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(190): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(std::_Bool)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(210): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(short)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(243): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(unsigned short)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(263): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(__w64 int)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(288): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(__w64 unsigned int)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(308): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(long)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(328): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(__w64 unsigned long)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(349): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(__int64)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(369): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(unsigned __int64)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(390): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(float)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(410): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(double)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(430): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(long double)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(450): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(const void *)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(470): oder &quot;std::basic_ostream&lt;_Elem,_Traits&gt; &amp;std::basic_ostream&lt;_Elem,_Traits&gt;::operator &lt;&lt;(std::basic_streambuf&lt;_Elem,_Traits&gt; *)&quot;<br />
1&gt; with<br />
1&gt; [<br />
1&gt; _Elem=char,<br />
1&gt; _Traits=std::char_traits&lt;char&gt;<br />
1&gt; ]<br />
1&gt; bei Anpassung der Argumentliste '(std::ostream, std::string)'<br />
1&gt;.\sprecher3.cpp(34) : error C2664: 'sndPlaySoundA': Konvertierung des Parameters 1 von 'std::string' in 'LPCSTR' nicht möglich<br />
1&gt; Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der Operator kann nicht aufgerufen werden<br />
1&gt;Das Buildprotokoll wurde unter &quot;file://c:\Users\XXX\Documents\Visual Studio 2008\Projects\training\funktionen1\sprecher3\sprecher3\Debug\BuildLog.htm&quot; gespeichert.<br />
1&gt;sprecher3 - 7 Fehler, 0 Warnung(en)<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1649066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649066</guid><dc:creator><![CDATA[intelfan]]></dc:creator><pubDate>Sat, 14 Feb 2009 13:20:33 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:45:38 GMT]]></title><description><![CDATA[<p>Steht doch alles da. Du verwendest die variable text ohne sie vorher zu deklarieren.<br />
Das hier</p>
<pre><code class="language-cpp">std::string = &quot;hallo toll&quot;;
</code></pre>
<p>sollte eher das hier sein</p>
<pre><code class="language-cpp">std::string text = &quot;hallo toll&quot;;
</code></pre>
<p>Den Aufruf von sndPlaySound musst du auch noch ändern da diese Funktion ein const char* als argument braucht.<br />
Also</p>
<pre><code class="language-cpp">sndPlaySound(datei.c_str(), SND_SYNC);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1649069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649069</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:45:38 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 17:46:31 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;string&gt;
</code></pre>
<p>Und nächstes Mal vielleicht nur die ersten paar Fehlermeldungen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649070</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 20 Jan 2009 17:46:31 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler: ...muss sich eine Klasse&#x2F;Struktur&#x2F;Union befinden on Tue, 20 Jan 2009 18:02:00 GMT]]></title><description><![CDATA[<p>thx für eure hilfe, jetzt klappts <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649079</guid><dc:creator><![CDATA[intelfan]]></dc:creator><pubDate>Tue, 20 Jan 2009 18:02:00 GMT</pubDate></item></channel></rss>