<?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[String Fehlermeldung]]></title><description><![CDATA[<p>Folgendes Programm, Welches für einen Wochentag einen Wert einlesen soll:</p>
<pre><code>#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;string&gt;
using namespace std;

int main(){
    vector&lt;int&gt; Montag;
    vector&lt;int&gt; Dienstag;
    vector&lt;int&gt; Mittwoch;
    vector&lt;int&gt; Donnerstag;
    vector&lt;int&gt; Freitag;
    vector&lt;int&gt; Samstag;
    vector&lt;int&gt; Sonntag;
    int werthalter=0;
    char entscheidung;
    string wochentag;

    cout&lt;&lt;&quot;Geben Sie bitte ein entsprechendes Wochentag Wert-Paar ein:&quot;;
    cin&gt;&gt;wochentag;&gt;&gt;werthalter;

    if (wochentag == 'Montag'){
        Montag.push_back(werthalter);

    }   

    return 0;
}
</code></pre>
<p>bekomme die Fehlermeldung</p>
<pre><code>g++    -c -g -std=c++11 -MMD -MP -MF &quot;build/Debug/GNU-Linux-x86/main.o.d&quot; -o build/Debug/GNU-Linux-x86/main.o main.cpp
main.cpp:23:22: warning: character constant too long for its type [enabled by default]
     if (wochentag == 'Montag'){
                      ^
main.cpp: In function ‘int main()’:
main.cpp:23:19: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string&lt;char&gt;}’ and ‘int’)
     if (wochentag == 'Montag'){
                   ^
</code></pre>
<p>Was hat der Compiler für ein Problem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/332697/string-fehlermeldung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 15:12:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/332697.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 May 2015 17:42:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to String Fehlermeldung on Sun, 17 May 2015 17:42:25 GMT]]></title><description><![CDATA[<p>Folgendes Programm, Welches für einen Wochentag einen Wert einlesen soll:</p>
<pre><code>#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;string&gt;
using namespace std;

int main(){
    vector&lt;int&gt; Montag;
    vector&lt;int&gt; Dienstag;
    vector&lt;int&gt; Mittwoch;
    vector&lt;int&gt; Donnerstag;
    vector&lt;int&gt; Freitag;
    vector&lt;int&gt; Samstag;
    vector&lt;int&gt; Sonntag;
    int werthalter=0;
    char entscheidung;
    string wochentag;

    cout&lt;&lt;&quot;Geben Sie bitte ein entsprechendes Wochentag Wert-Paar ein:&quot;;
    cin&gt;&gt;wochentag;&gt;&gt;werthalter;

    if (wochentag == 'Montag'){
        Montag.push_back(werthalter);

    }   

    return 0;
}
</code></pre>
<p>bekomme die Fehlermeldung</p>
<pre><code>g++    -c -g -std=c++11 -MMD -MP -MF &quot;build/Debug/GNU-Linux-x86/main.o.d&quot; -o build/Debug/GNU-Linux-x86/main.o main.cpp
main.cpp:23:22: warning: character constant too long for its type [enabled by default]
     if (wochentag == 'Montag'){
                      ^
main.cpp: In function ‘int main()’:
main.cpp:23:19: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string&lt;char&gt;}’ and ‘int’)
     if (wochentag == 'Montag'){
                   ^
</code></pre>
<p>Was hat der Compiler für ein Problem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2453827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2453827</guid><dc:creator><![CDATA[softpad]]></dc:creator><pubDate>Sun, 17 May 2015 17:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to String Fehlermeldung on Sun, 17 May 2015 17:56:21 GMT]]></title><description><![CDATA[<p>Du musst zumindeste doppelte Anführungszeichen verwenden, einzelne sind für chars. Ob da noch mehr Fehler drin sind, weiß ich nicht, hab mir den Rest nicht angschaut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2453828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2453828</guid><dc:creator><![CDATA[Mechanics]]></dc:creator><pubDate>Sun, 17 May 2015 17:56:21 GMT</pubDate></item><item><title><![CDATA[Reply to String Fehlermeldung on Sun, 17 May 2015 18:06:44 GMT]]></title><description><![CDATA[<p>Danke..! mit doppelten geht's</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2453832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2453832</guid><dc:creator><![CDATA[softpad]]></dc:creator><pubDate>Sun, 17 May 2015 18:06:44 GMT</pubDate></item></channel></rss>