<?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[Anfängerecke]]></title><description><![CDATA[<p>Ich bin noch völlig am Anfang und dann auch noch Fernstudent.<br />
Ich hoffe ihr könnt mir bei dem einen oder anderen Punkt auf die Sprünge helfen.</p>
<p>Wie zum Bsp. bei diesem:</p>
<p>Muß ich bei Operatoren, Sequenzen, Methoden auf Freizeichen achten?</p>
<p>#include&lt;iostream&gt;<br />
Using namespace std;<br />
int main()<br />
{<br />
cout&lt;&lt;&quot;\&quot;HelloWorld\&quot;&quot;&lt;&lt;endl;<br />
}</p>
<p>Die Zeile, in der die Operatoren das &quot;Hello World&quot; in die Ausgabe schieben muss ich da auf Leerzeichen zwischen dem cout und den &lt;&lt; Operatoren sowie den folgenden Sequenzen achten oder ist das egal?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/319585/anfängerecke</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Jul 2026 03:39:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/319585.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Aug 2013 14:05:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:05:29 GMT]]></title><description><![CDATA[<p>Ich bin noch völlig am Anfang und dann auch noch Fernstudent.<br />
Ich hoffe ihr könnt mir bei dem einen oder anderen Punkt auf die Sprünge helfen.</p>
<p>Wie zum Bsp. bei diesem:</p>
<p>Muß ich bei Operatoren, Sequenzen, Methoden auf Freizeichen achten?</p>
<p>#include&lt;iostream&gt;<br />
Using namespace std;<br />
int main()<br />
{<br />
cout&lt;&lt;&quot;\&quot;HelloWorld\&quot;&quot;&lt;&lt;endl;<br />
}</p>
<p>Die Zeile, in der die Operatoren das &quot;Hello World&quot; in die Ausgabe schieben muss ich da auf Leerzeichen zwischen dem cout und den &lt;&lt; Operatoren sowie den folgenden Sequenzen achten oder ist das egal?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348291</guid><dc:creator><![CDATA[Limonade]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:05:29 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:11:51 GMT]]></title><description><![CDATA[<p>Es ist egal, aber &lt;&lt; muss &lt;&lt; bleiben. Das gleiche gilt auch für alle anderen Operatoren und innerhalb von Namen (Variable, Funktion) darfst du keine Leerzeichen haben, aber zwischen verschiedenen Bezeichnern kannst du beliebig viele Lücken haben.</p>
<p>EDIT: Mit</p>
<pre><code>cout&lt;&lt;&quot;&quot;HelloWorld&quot;&quot;&lt;&lt;endl;
</code></pre>
<p>meinst du wohl</p>
<pre><code>cout&lt;&lt;&quot;HelloWorld&quot;&lt;&lt;endl;
</code></pre>
<p>und statt endl sollte man meistens &quot;\n&quot; nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348293</guid><dc:creator><![CDATA[Marthog]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:11:51 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:17:09 GMT]]></title><description><![CDATA[<p>Danke. Bei der Hello World - Ausgabe hatte es scheinbar die Sequenzen nicht mit reinkopiert.</p>
<p>Es ging darum: &quot;Hello World&quot;<br />
auszugeben. (Also in Anführungsstrichen.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348294</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348294</guid><dc:creator><![CDATA[Limonade]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:17:09 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:22:02 GMT]]></title><description><![CDATA[<p>Kommt drauf an Marthog, bei Logging Ausgaben würde ich immer endl nehmen, weil es den Stream flusht.</p>
<p>Aber back2topic:<br />
Jegliche Whitespaces sind egal, ob du 3 Leerzeichen oder 20 freie Zeilen irgendwo hast juckt keinen (ausser dem menschlichen Leser ;))</p>
<p>Bei Präprozessorkommandos sieht es allerdings anders aus.</p>
<pre><code>#define
#if
#include
#else // Kommentar
#endif
#else if

int main(int argc, char *argv[]);
</code></pre>
<p>Du siehst hier schon durch die Forensoftware, dass das andere Farben sind. Und jedes Kommando erstreckt sich auf eine ganze Zeile (Kommentare ausgenommen).</p>
<p>Edit: Und wie du spezielle Zeichen in Strings darstellt kommt auch bald in deinem Lehrbuch ;).</p>
<pre><code>&quot;\&quot;Hallo Welt\&quot; mit \a und \t und\n dann nochmal \r und weiter gehts.\\&quot;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2348295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348295</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:22:02 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:23:01 GMT]]></title><description><![CDATA[<p>Marthog schrieb:</p>
<blockquote>
<p>und statt endl sollte man meistens <s>&quot;\n&quot;</s> nehmen.</p>
</blockquote>
<p><code>'\n'</code></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348296</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:23:01 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:50:36 GMT]]></title><description><![CDATA[<p>Man darf zwischen sog. Token Leerzeichen lassen.</p>
<blockquote>
<p>There are five kinds of tokens: identifiers, keywords, literals, operators [and punctuators], and other separators. Blanks, horizontal and vertical tabs, newlines, formfeeds, and comments (collectively, “white space”), as described below, <strong>are ignored except as they serve to separate tokens</strong>.<br />
[ Note: Some white space is required to separate otherwise adjacent identifiers, keywords, numeric literals, and alternative tokens containing alphabetic characters. —end note ]</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2348297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348297</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:50:36 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 14:53:41 GMT]]></title><description><![CDATA[<blockquote>
<p>bei Logging Ausgaben würde ich immer endl nehmen, weil es den Stream flusht.</p>
</blockquote>
<p>Dafür gibt es das<a href="http://en.cppreference.com/w/cpp/io/manip/unitbuf" rel="nofollow"> <code>unitbuf</code> </a>-Flag.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348298</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 24 Aug 2013 14:53:41 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 15:11:44 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>Kommt drauf an Marthog, bei Logging Ausgaben würde ich immer endl nehmen, weil es den Stream flusht.</p>
</blockquote>
<p>Würd ich nicht. Ich würd wohl das nehmen:</p>
<pre><code>ofstream log;
log.setbuf(0,0);
log.open(&quot;log.txt&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2348300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348300</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Sat, 24 Aug 2013 15:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 15:18:56 GMT]]></title><description><![CDATA[<p>Okay. unitbuf. Man ist immer noch alles so neu für mich <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/2348302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348302</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sat, 24 Aug 2013 15:18:56 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 17:34:05 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>bei Logging Ausgaben würde ich immer endl nehmen, weil es den Stream flusht.</p>
</blockquote>
<p>Dafür gibt es das<a href="http://en.cppreference.com/w/cpp/io/manip/unitbuf" rel="nofollow"> <code>unitbuf</code> </a>-Flag.</p>
</blockquote>
<p>Das ist wieder zu langsam. Typische Loggingzeile:</p>
<pre><code class="language-cpp">clog &lt;&lt; &quot;Debug-Wert: &quot; &lt;&lt; x &lt;&lt; '\n'; // 3 flushs (unitbuf)
clog &lt;&lt; &quot;Debug-Wert: &quot; &lt;&lt; x &lt;&lt; endl; // 1 flush (kein unitbuf)
</code></pre>
<p>Macht alles 3x so langsam. Ich will doch keine Zeit verbraten. Ich will line-buffering. Geht nicht mit iostreams. Also nehm ich endl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348334</guid><dc:creator><![CDATA[unitbuf]]></dc:creator><pubDate>Sat, 24 Aug 2013 17:34:05 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 22:37:28 GMT]]></title><description><![CDATA[<p>Es geht um die Escape-Sequenzen.<br />
Die doppelten Anführungsstriche &quot;&quot; sind ja zur Eingrenzung<br />
von Zeichenketten da.<br />
Wozu nutzt man denn ' ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348357</guid><dc:creator><![CDATA[Limonade]]></dc:creator><pubDate>Sat, 24 Aug 2013 22:37:28 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sat, 24 Aug 2013 23:22:39 GMT]]></title><description><![CDATA[<p>' ist für einzelne Buchstaben<br />
&quot;&quot; ist für mehrere Buchstaben</p>
<p>Der Unterschied ist, dass 'c' z.B. ein normaler Wert (vom Typ char) ist, der auch als Zahl ausgedrückt werden kann.<br />
&quot;hello&quot; ist ein array aus Buchstaben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2348359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348359</guid><dc:creator><![CDATA[Marthog]]></dc:creator><pubDate>Sat, 24 Aug 2013 23:22:39 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sun, 25 Aug 2013 14:37:35 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>Präprozessorkommandos</p>
<pre><code>#else if
</code></pre>
</blockquote>
<pre><code>#elif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2348443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2348443</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 25 Aug 2013 14:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sun, 01 Sep 2013 16:05:40 GMT]]></title><description><![CDATA[<p>int main() {<br />
int x = 10;<br />
bool a =(x &gt;= 10);<br />
bool b = (x &lt; 5);<br />
cout &lt;&lt; boolaplha &lt;&lt; a&lt;&lt; endl;<br />
cout &lt;&lt; b &lt;&lt;endl;</p>
<p>Gegeben war aufgelisteter Codeschnipsel. Er ist nicht vollständig nur ein Schnipsel.<br />
Mir geht es um die Ausgabe von a.<br />
boolalpha ist ja dafür da, dass man bool-Variablen nicht nummerisch sondern<br />
textlich ausgeben kann.<br />
a wäre hier in dem fall ja 1 oder auch wahr.<br />
wird in dem fall dann &quot;eins&quot; ausgegeben oder &quot;wahr&quot; also in textfor beides.<br />
b würde dann ja auch textlich ausgegeben werden als &quot;null&quot; oder als &quot;false&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349693</guid><dc:creator><![CDATA[Limonade]]></dc:creator><pubDate>Sun, 01 Sep 2013 16:05:40 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerecke on Sun, 01 Sep 2013 16:07:11 GMT]]></title><description><![CDATA[<p>Limonade schrieb:</p>
<blockquote>
<p>a wäre hier in dem fall ja 1 oder auch wahr.<br />
wird in dem fall dann &quot;eins&quot; ausgegeben oder &quot;wahr&quot; also in textfor beides.<br />
b würde dann ja auch textlich ausgegeben werden als &quot;null&quot; oder als &quot;false&quot;?</p>
</blockquote>
<p>a wird - weil die Standardlocale eingestellt ist - als true ausgegeben, b als false.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349696</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sun, 01 Sep 2013 16:07:11 GMT</pubDate></item></channel></rss>