<?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[EINLESEN C++]]></title><description><![CDATA[<p>hallo leute kann mir jemand erklären wie ich ein von z.B maximal 10 Zahlen einlesen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/310917/einlesen-c</link><generator>RSS for Node</generator><lastBuildDate>Tue, 04 Aug 2026 07:53:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/310917.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Nov 2012 18:30:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 18:30:57 GMT]]></title><description><![CDATA[<p>hallo leute kann mir jemand erklären wie ich ein von z.B maximal 10 Zahlen einlesen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273529</guid><dc:creator><![CDATA[JAVA21]]></dc:creator><pubDate>Thu, 22 Nov 2012 18:30:57 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 18:32:00 GMT]]></title><description><![CDATA[<p>Tschuldigung vergessen.<br />
Wie kann ich ein Array einlesen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273531</guid><dc:creator><![CDATA[JAVA21]]></dc:creator><pubDate>Thu, 22 Nov 2012 18:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 18:36:53 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int a[10];
cin &gt;&gt; a[0] &gt;&gt; a[1] &gt;&gt; a[2] &gt;&gt; a[3] &gt;&gt; a[4] &gt;&gt; a[5] &gt;&gt; a[6] &gt;&gt; a[7] &gt;&gt; a[8] &gt;&gt; a[9];
</code></pre>
<p>nun werden 10 Zahlen mit Leerzeichen getrennt eingelesen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273532</guid><dc:creator><![CDATA[Eine Antwort]]></dc:creator><pubDate>Thu, 22 Nov 2012 18:36:53 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:00:58 GMT]]></title><description><![CDATA[<p>Kann man das nicht irgendwie schöner darstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273543</guid><dc:creator><![CDATA[Java21]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:00:58 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:05:27 GMT]]></title><description><![CDATA[<pre><code>#include &lt;array&gt;
#include &lt;iostream&gt;

int main()
{
    std::array&lt;int, 10&gt; ar;

    for (auto &amp;it : ar)
    {
        std::cout &lt;&lt; &quot;Geben sie einen wert ein:&quot;;
        std::cin &gt;&gt; it;
    }
    std::cout &lt;&lt; &quot;Ihre Werte:\n&quot;;
    for (auto &amp;it : ar)
    {
        std::cout &lt;&lt; it &lt;&lt; &quot;\n&quot;;
    }
}
</code></pre>
<p>Eher so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273544</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273544</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:05:27 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:08:03 GMT]]></title><description><![CDATA[<p>Ja sieht schön aus aber man muss es ja auch verstehen . Was bewirkt denn dieses Std ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273545</guid><dc:creator><![CDATA[Java21]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:11:44 GMT]]></title><description><![CDATA[<blockquote>
<p>Ja sieht schön aus aber man muss es ja auch verstehen . Was bewirkt denn dieses Std ?</p>
</blockquote>
<p>Welches Buch liest du? Eins von Jürgen Wolf?</p>
<p><code>std</code> + Scope-Operator ( <code>::</code> ) bedeutet, dass ich auf einen Namen (konkret in diesem Fall auf die Instanz einer Klasse [ <code>cout</code> / <code>cin</code> ] bzw. auf einen Klassennamen [ <code>array</code> ]), der im Namensraum/Namespace <code>std</code> liegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273547</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:14:56 GMT]]></title><description><![CDATA[<p>Java21 schrieb:</p>
<blockquote>
<p>Ja sieht schön aus aber man muss es ja auch verstehen . Was bewirkt denn dieses Std ?</p>
</blockquote>
<p>Hol dir besser ein Grundlagenbuch, sonst bringt das hier alles nichts.<br />
Dazu nutzt Tobis Lösung C++11-Features ( <code>std::array</code> , range-based <code>for</code> ), die wirst du mit so wenig Vorwissen nicht so ohne weiteres Verstehen.</p>
<p>Oder wenn du einfach eine Antwort haben willst:<br />
N3337 17.6.2 / 1</p>
<blockquote>
<p>All library entities except macros, operator new and operator delete are defined within the namespace<br />
std or namespaces nested within namespace std.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2273548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273548</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:14:56 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 19:13:25 GMT]]></title><description><![CDATA[<p>PS: Manche Leute bevorzugen es, den Namespace <code>std</code> global auszuschütten àla</p>
<pre><code>using namespace std;
</code></pre>
<p>Ist aber manchmal hinderlich, da es zu Namenskonflikten kommen könnte.<br />
(Nur so als Info, weil viele Bücher am Anfang damit arbeiten)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273549</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:13:25 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 22:30:37 GMT]]></title><description><![CDATA[<p>Nunja, Antworts Lösung erfordert mehrere Zahlen, die mit Leerzeichen getrennt eingegeben werden. Tobis Lösung erfordert nach jedem Eintrag ein Enter, da kann man sich fragen, was man &quot;schöner&quot; findet. Die Schönheit hängt eben davon ab, was man überhaupt erreichen möchte und wie man diese Daten erwartet.</p>
<p>Normalerweise weiß ein Benutzer z.B. gar nicht, was er jetzt eingeben soll. Dann ist es schon schlau, wenn für jeden Wert angegeben wird, was etwas bedeutet.</p>
<p>Ist das jedoch klar, so sind viele mit Leerzeichen getrennt angegebene Werte durchaus zielführend.</p>
<p>Und ansonsten sollte der Benutzer vielleicht überhaupt nichts explizit angeben müssen und ein Einlesen aus einer Datei ist die beste Lösung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273633</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Thu, 22 Nov 2012 22:30:37 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Thu, 22 Nov 2012 23:50:03 GMT]]></title><description><![CDATA[<p>Eisflamme schrieb:</p>
<blockquote>
<p>Tobis Lösung erfordert nach jedem Eintrag ein Enter, (...)</p>
</blockquote>
<p>Nein, tut sie nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273644</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Thu, 22 Nov 2012 23:50:03 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Fri, 23 Nov 2012 00:34:31 GMT]]></title><description><![CDATA[<blockquote>
<p>Nein, tut sie nicht.</p>
</blockquote>
<p>Man könnte die Werte auch durch Leerzeichen getrennt auf eine Zeile schreiben, dann würde sie sich <code>cout</code> halt nacheinander aus dem Puffer holen. Aber das ist doch ehrlich gesagt Haarspalterei.<br />
Exakterweise fordert meine Lösung nach jedem Wert ein Whitespace.</p>
<p>Hatte einfach keine Lust, <code>getline</code> zu benutzen, war ja auch nur so schnell hingeschrieben.</p>
<blockquote>
<p>Dazu nutzt Tobis Lösung C++11-Features (std::array, range-based for), die wirst du mit so wenig Vorwissen nicht so ohne weiteres Verstehen.</p>
</blockquote>
<p>Ach ja stimmt, fällt mir inzwischen gar nicht mehr auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273652</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Fri, 23 Nov 2012 00:34:31 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Fri, 23 Nov 2012 08:32:25 GMT]]></title><description><![CDATA[<p>oh, sorry</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273704</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Fri, 23 Nov 2012 08:32:25 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Fri, 23 Nov 2012 09:31:33 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Dazu nutzt Tobis Lösung C++11-Features ( <code>std::array</code> , range-based <code>for</code> ), die wirst du mit so wenig Vorwissen nicht so ohne weiteres Verstehen.</p>
</blockquote>
<p>Nur weil &quot;unsereiner&quot; die C++11 features im Vergleich zu den C++03 Features als neu und noch ungewohnt empfindet heißt das nicht, dass ein C++-Neuling die Sachen komplizierter finden muss als den Rest. Im Grunde ist vom Konzept her range-based-for leichter zu verstehen als das altbekannte Iterator-Gehoppel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273725</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Fri, 23 Nov 2012 09:31:33 GMT</pubDate></item><item><title><![CDATA[Reply to EINLESEN C++ on Fri, 23 Nov 2012 10:07:42 GMT]]></title><description><![CDATA[<blockquote>
<p>Nur weil &quot;unsereiner&quot; die C++11 features im Vergleich zu den C++03 Features als neu und noch ungewohnt empfindet heißt das nicht, dass ein C++-Neuling die Sachen komplizierter finden muss als den Rest.</p>
</blockquote>
<p>Es ging nicht darum, ob ein Neuling sie schwerer oder leichter findet, sondern darum, ob er sie ohne Vorwissen versteht. Ich würde - hätte ich mein C++11 Buch nicht gelesen - Sachen wie Range-Based-for oder Initializer-Lists auch nicht verstehen, und davon, dass jedes Anfängerbuch auf C++11 eingeht sind wir noch Lichtjahre entfernt.</p>
<pre><code>#include &lt;tr1/array&gt;
#include &lt;iostream&gt;

int main()
{
    using std::tr1::array;
    array&lt;int, 10&gt; ar;

    for (unsigned i(0); i&lt;ar.size(); ++i)
    {
        std::cout &lt;&lt; &quot;Geben sie einen wert ein:&quot;;
        std::cin &gt;&gt; ar[i];
    }
    std::cout &lt;&lt; &quot;Ihre Werte:\n&quot;;
    for (unsigned i(0); i&lt;ar.size(); ++i)
    {
        std::cout &lt;&lt; ar[i] &lt;&lt; &quot;\n&quot;;
    }
}
</code></pre>
<p>So, hier nochmal für all die krümelkacker, die nichts von C++11 halten. Benutze aber trotzdem die Features des TR1.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2273746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2273746</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Fri, 23 Nov 2012 10:07:42 GMT</pubDate></item></channel></rss>