<?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[Zeilenumbruch ohne Anweisung?]]></title><description><![CDATA[<p>Hay <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>
<p>Hier der Ausschnitt meines Codes:</p>
<pre><code class="language-cpp">...
  do
  {
       std::cout &lt;&lt; &quot;Bitte Zahl eingeben: &quot;;
       std::cin &gt;&gt; zahl1;
  if(zahl1)
  {
         struct knoten *k = new knoten;
         k-&gt;zahl = zahl1;
         k-&gt;next = a;
         a = k;

  }
 } while(zahl1);
...
</code></pre>
<p>Was ich mich frage:<br />
Warum ist die Ausgabe von dem Programm:<br />
Bitte Zahl eingeben: 1<br />
Bitte Zahl eingeben: 2<br />
Bitte Zahl eingeben: 3</p>
<p>Die Zahlen hab ich eingegeben, danach steht das nächste &quot;Bitte Zahl eingeben in einer neuen Zeile, ohne dass ich den Befehl dazu gegeben hätte. Macht zwar keinen Unterschied von der Funktionsweise des Programmes, verwirrt mich allerdings trotzdem.</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/254964/zeilenumbruch-ohne-anweisung</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 06:59:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/254964.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Nov 2009 20:15:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:15:25 GMT]]></title><description><![CDATA[<p>Hay <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>
<p>Hier der Ausschnitt meines Codes:</p>
<pre><code class="language-cpp">...
  do
  {
       std::cout &lt;&lt; &quot;Bitte Zahl eingeben: &quot;;
       std::cin &gt;&gt; zahl1;
  if(zahl1)
  {
         struct knoten *k = new knoten;
         k-&gt;zahl = zahl1;
         k-&gt;next = a;
         a = k;

  }
 } while(zahl1);
...
</code></pre>
<p>Was ich mich frage:<br />
Warum ist die Ausgabe von dem Programm:<br />
Bitte Zahl eingeben: 1<br />
Bitte Zahl eingeben: 2<br />
Bitte Zahl eingeben: 3</p>
<p>Die Zahlen hab ich eingegeben, danach steht das nächste &quot;Bitte Zahl eingeben in einer neuen Zeile, ohne dass ich den Befehl dazu gegeben hätte. Macht zwar keinen Unterschied von der Funktionsweise des Programmes, verwirrt mich allerdings trotzdem.</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1812602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812602</guid><dc:creator><![CDATA[Undefined_cl]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:21:26 GMT]]></title><description><![CDATA[<p>Wenn <code>zahl1</code> in einem booleschen Kontext verwendet wird, wie z.B. in der <code>if</code> - oder <code>do while</code> -Bedingung, wird es als Wahrheitswert, also <code>true</code> oder <code>false</code> interpretiert. Dabei ist jeder Wert ungleich Null <code>true</code> und nur Null <code>false</code> . Von daher läuft deine Schleife weiter, solange du nicht 0 eingibst.</p>
<p>Wird der mit <code>new</code> angeforderte Speicher eigentlich wieder freigegeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1812605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812605</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:21:26 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:23:27 GMT]]></title><description><![CDATA[<p>Ja, die Schleife läuft weiter, aber WARUM steht &quot;Bitte Zahl eingeben&quot; beim zweiten Durchlauf, in einer neuen Zeile, ohne den Befehl &quot;\n&quot;;</p>
<p>Das war die eigentliche Frage.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1812608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812608</guid><dc:creator><![CDATA[Undefined_cl]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:23:27 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:23:31 GMT]]></title><description><![CDATA[<p>Du hast bestimmt nach jeder Eingabe Enter gedrückt, richtig? Gib mal probehalber beim nächsten Versuch <strong>1 2</strong>&lt;Enter&gt; ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1812609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812609</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:23:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:25:35 GMT]]></title><description><![CDATA[<p>In der Tat, ein interessantes Ergebnis.<br />
Wenn ich zwischen 1 und 2 ein Leerzeichen setzte, erscheint folgende Ausgabe:</p>
<p>Bitte Zahl eingeben: 1 2 //dann Enter.<br />
Bitte Zahl eingeben: Bitte Zahl eingeben:</p>
<p>Irgendwas mach ich wohl falsch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1812611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812611</guid><dc:creator><![CDATA[Undefined_cl]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:25:35 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch ohne Anweisung? on Mon, 23 Nov 2009 20:30:23 GMT]]></title><description><![CDATA[<p>@ Nexus</p>
<pre><code class="language-cpp">while(a)
{
        struct knoten *k = new knoten;
        k-&gt;zahl = a-&gt;zahl;
        k-&gt;next = b;
        b = k;
        o = a;
        a = a-&gt;next;
        delete o;
}

while(b)
{
        o = b;
        std::cout &lt;&lt; &quot;\nZahl: &quot; &lt;&lt; b-&gt;zahl;
        b= b-&gt;next;
        delete o;
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1812614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1812614</guid><dc:creator><![CDATA[Undefined_cl]]></dc:creator><pubDate>Mon, 23 Nov 2009 20:30:23 GMT</pubDate></item></channel></rss>