<?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[invalid operands of types &#x27;char*&#x27; and &#x27;char&#x27; to binary &#x27;operator&amp;lt;&amp;lt;&#x27;]]></title><description><![CDATA[<p>Hallo.<br />
Habe hier ein kleines Problem, und zwar verstehe ich diese Fehlermeldung irgendwie nicht...</p>
<p>Hier der Code:</p>
<pre><code>// Gib eine ASCII-Zeichenfolge mit dem gespeicherten Format zurück
// Format = 1 Aug 29, 1991
// Format = 2 29.8.91
// Format = 3 29.8.1991
// Format = 4 29 Aug 1991 Militärische Zeit
// Format = ? Alles andere wird als Format 1 interpretiert
char* Date::generiereFormatiertesDatum()
{
    srand(time(NULL));
    int t = (rand()% 31) +1;
    int m = (rand()% 12) +1;
    int j = (rand()% 1999-1990+1) +1990;
    this-&gt;setzeDatum(t,m,j);

    switch(this-&gt;format)
    {
        case 1: return this-&gt;getMonatsName() &lt;&lt; ' ' &lt;&lt; this-&gt;getTag() &lt;&lt; &quot;, &quot; &lt;&lt; this-&gt;getJahr(); 
        case 2: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonat() &lt;&lt; '.' &lt;&lt; this-&gt;getJahr()%100;   
        case 3: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonat() &lt;&lt; '.' &lt;&lt; this-&gt;getJahr();       
        case 4: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonatsName() &lt;&lt; ' ' &lt;&lt; this-&gt;getJahr();  
    }

}
</code></pre>
<p>Hier die Fehlermeldungen:<br />
<a href="http://www.imagebanana.com/view/jwwwgs26/Unbenannt.PNG" rel="nofollow">http://www.imagebanana.com/view/jwwwgs26/Unbenannt.PNG</a></p>
<p>Bhoa, wäre euch sehr dankbar, wenn ihr mir helfen könntet <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/315462/invalid-operands-of-types-char-and-char-to-binary-operator-lt-lt</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 18:04:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/315462.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Apr 2013 22:07:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to invalid operands of types &#x27;char*&#x27; and &#x27;char&#x27; to binary &#x27;operator&amp;lt;&amp;lt;&#x27; on Tue, 02 Apr 2013 22:07:50 GMT]]></title><description><![CDATA[<p>Hallo.<br />
Habe hier ein kleines Problem, und zwar verstehe ich diese Fehlermeldung irgendwie nicht...</p>
<p>Hier der Code:</p>
<pre><code>// Gib eine ASCII-Zeichenfolge mit dem gespeicherten Format zurück
// Format = 1 Aug 29, 1991
// Format = 2 29.8.91
// Format = 3 29.8.1991
// Format = 4 29 Aug 1991 Militärische Zeit
// Format = ? Alles andere wird als Format 1 interpretiert
char* Date::generiereFormatiertesDatum()
{
    srand(time(NULL));
    int t = (rand()% 31) +1;
    int m = (rand()% 12) +1;
    int j = (rand()% 1999-1990+1) +1990;
    this-&gt;setzeDatum(t,m,j);

    switch(this-&gt;format)
    {
        case 1: return this-&gt;getMonatsName() &lt;&lt; ' ' &lt;&lt; this-&gt;getTag() &lt;&lt; &quot;, &quot; &lt;&lt; this-&gt;getJahr(); 
        case 2: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonat() &lt;&lt; '.' &lt;&lt; this-&gt;getJahr()%100;   
        case 3: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonat() &lt;&lt; '.' &lt;&lt; this-&gt;getJahr();       
        case 4: return this-&gt;getTag() &lt;&lt; '.' &lt;&lt; this-&gt;getMonatsName() &lt;&lt; ' ' &lt;&lt; this-&gt;getJahr();  
    }

}
</code></pre>
<p>Hier die Fehlermeldungen:<br />
<a href="http://www.imagebanana.com/view/jwwwgs26/Unbenannt.PNG" rel="nofollow">http://www.imagebanana.com/view/jwwwgs26/Unbenannt.PNG</a></p>
<p>Bhoa, wäre euch sehr dankbar, wenn ihr mir helfen könntet <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2311941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2311941</guid><dc:creator><![CDATA[iN3verM1nd]]></dc:creator><pubDate>Tue, 02 Apr 2013 22:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to invalid operands of types &#x27;char*&#x27; and &#x27;char&#x27; to binary &#x27;operator&amp;lt;&amp;lt;&#x27; on Tue, 02 Apr 2013 22:25:14 GMT]]></title><description><![CDATA[<p>Die Fehlermeldung ist nur das Symptom. Beschäftige dich mit Zeichenketten in C++. Bei dir ist, offen gesagt, alles vollkommen falsch. Ein erster, wichtiger Schritt wäre std::string. Die sind wesentlich anfängerfreundlicher als die Frickelei mit char-Arrays (Wie kommst du überhaupt auf die Idee? Hast du ein statt C++ ein Buch über C gelesen?). Damit kannst du auch Zeichenketten verknüpfen. Das geht mit char-Arrays nämlich nicht (so einfach). Der zweite Schritt wäre dann std::stringstream, da kannst du dann auch Zeichenketten und andere Datentypen zusammensetzen, so wie du es hier versuchst.</p>
<p>An deinem konkreten Code ist hier jedoch nichts zu retten. Alles falsch. Ohne string und stringstream geht das nur mit gröbsten Verrenkungen (oder mit der C-Bibliothek). Mit ist es ganz einfach. Dafür musst du sie dir aber erst einmal angucken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2311949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2311949</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 02 Apr 2013 22:25:14 GMT</pubDate></item><item><title><![CDATA[Reply to invalid operands of types &#x27;char*&#x27; and &#x27;char&#x27; to binary &#x27;operator&amp;lt;&amp;lt;&#x27; on Tue, 02 Apr 2013 22:44:33 GMT]]></title><description><![CDATA[<p>Hinzu kommt noch, dass</p>
<pre><code class="language-cpp">srand(time(NULL));
</code></pre>
<p>nur einmal im Code aufgerufen werden sollte. Bei jedem Funktionsaufruf das Seed mit dem gleichen Wert zu initialisieren fuehrt nur dazu, dass stehts die gleichen (dann nicht mehr so zufaelligen) Zufallszahlen generiert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2311954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2311954</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Tue, 02 Apr 2013 22:44:33 GMT</pubDate></item></channel></rss>