<?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[&amp;quot;Frage zu Arrays &amp;quot;]]></title><description><![CDATA[<p>hallo Leute,<br />
hoffe ,dass meine frage hier richtig ist und zwar es geht um arrays.<br />
wie kann ich nummerische werte in ein arrey oder mehrere einlesen , und übliche operationen mit denen machen.<br />
das habe ich so versucht aber es geht nicht, wieso?</p>
<p>#include&lt;iostream&gt;<br />
using namespace std;<br />
int main(){<br />
long feld []={};<br />
cin&gt;&gt;feld;<br />
cout&lt;&lt;feld [0]+ feld [2]&lt;&lt;endl;</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}</p>
<p>als string geht aber die operationen kann ich nicht machen.<br />
zb:<br />
#include&lt;iostream&gt;<br />
using namespace std;<br />
int main(){<br />
char feld[10];</p>
<p>cin&gt;&gt;feld;<br />
int i=1;</p>
<p>cout&lt;&lt;feld[1]+feld[i]&lt;&lt;endl;--&gt; das ergebniss stimmt nicht.</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}<br />
danke für euere hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/277975/quot-frage-zu-arrays-quot</link><generator>RSS for Node</generator><lastBuildDate>Tue, 25 Aug 2026 15:31:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/277975.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Nov 2010 14:26:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sat, 27 Nov 2010 14:26:52 GMT]]></title><description><![CDATA[<p>hallo Leute,<br />
hoffe ,dass meine frage hier richtig ist und zwar es geht um arrays.<br />
wie kann ich nummerische werte in ein arrey oder mehrere einlesen , und übliche operationen mit denen machen.<br />
das habe ich so versucht aber es geht nicht, wieso?</p>
<p>#include&lt;iostream&gt;<br />
using namespace std;<br />
int main(){<br />
long feld []={};<br />
cin&gt;&gt;feld;<br />
cout&lt;&lt;feld [0]+ feld [2]&lt;&lt;endl;</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}</p>
<p>als string geht aber die operationen kann ich nicht machen.<br />
zb:<br />
#include&lt;iostream&gt;<br />
using namespace std;<br />
int main(){<br />
char feld[10];</p>
<p>cin&gt;&gt;feld;<br />
int i=1;</p>
<p>cout&lt;&lt;feld[1]+feld[i]&lt;&lt;endl;--&gt; das ergebniss stimmt nicht.</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}<br />
danke für euere hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1986716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1986716</guid><dc:creator><![CDATA[jassa]]></dc:creator><pubDate>Sat, 27 Nov 2010 14:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sat, 27 Nov 2010 15:08:12 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::vector&lt;int&gt; feld;
std::istream_iterator&lt;int&gt; in(std::cin), eos;
std::copy(in, eos, std::back_inserter(feld));
std::cout &lt;&lt; feld[0] + feld[2] &lt;&lt; std::endl;
</code></pre>
<p>Das wirst du zwar nicht verstehen, aber so macht man das normalerweise. Du sollst aber wissen, dass ein Array immer die gleiche Grösse hat und du deshalb einen std::vector verwenden musst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1986729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1986729</guid><dc:creator><![CDATA[stlart]]></dc:creator><pubDate>Sat, 27 Nov 2010 15:08:12 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sat, 27 Nov 2010 15:25:39 GMT]]></title><description><![CDATA[<p>du hast recht , ich verstehe es überhaupt nicht.<br />
bitte schreibe es mir wie es in meinem code ausschaut.<br />
eine vollständige erklärung natürlich wäre viel besser für mich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1986738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1986738</guid><dc:creator><![CDATA[jassa]]></dc:creator><pubDate>Sat, 27 Nov 2010 15:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sat, 27 Nov 2010 15:27:09 GMT]]></title><description><![CDATA[<p>wie ich sehe du verwendest eine funktion ...<br />
ich brauche es in einem möglicht einfacherem beispiel , wie meiner ,danke grüsse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1986740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1986740</guid><dc:creator><![CDATA[jassa]]></dc:creator><pubDate>Sat, 27 Nov 2010 15:27:09 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sat, 27 Nov 2010 17:07:49 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;
int main(){
  long feld[2];
  cin &gt;&gt; feld[0] &gt;&gt; feld[1];
  cout &lt;&lt; feld[0] + feld[1]&lt;&lt;endl;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1986768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1986768</guid><dc:creator><![CDATA[Bleistift]]></dc:creator><pubDate>Sat, 27 Nov 2010 17:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sun, 28 Nov 2010 14:08:35 GMT]]></title><description><![CDATA[<p>nein , also leider es ist kein antwort für mich.</p>
<p>Bleistift schrieb:</p>
<blockquote>
<pre><code class="language-cpp">##include&lt;iostream&gt;
using namespace std;
int main(){
long feld []={};
cin&gt;&gt;feld;//---&gt;mich interesiert ob es möglicht ist hier zb. 123 eingeben , und dass compiler eine zuordnung macht :long feld []={1,2,3} automatisch????
cout&lt;&lt;feld [0]+ feld [2]&lt;&lt;endl;

system(&quot;pause&quot;);
return 0;
}
</code></pre>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1987047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1987047</guid><dc:creator><![CDATA[jassa]]></dc:creator><pubDate>Sun, 28 Nov 2010 14:08:35 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Frage zu Arrays &amp;quot; on Sun, 28 Nov 2010 14:43:47 GMT]]></title><description><![CDATA[<blockquote>
<p>//---&gt;mich interesiert ob es möglicht ist hier zb. 123 eingeben , und dass compiler eine zuordnung macht :long feld []={1,2,3} automatisch????</p>
</blockquote>
<p>Nein, das ist nicht möglich.</p>
<p>Die Größe des Arrays muss zur Compilezeit feststehen, ansonsten musst du auf std::vector, std::list, etc. ausweichen. Aber auch dann musst du die Eingabe in einer Schleife erledigen, etwa so:</p>
<pre><code class="language-cpp">#include &lt;list&gt;
#include &lt;iostream&gt;
using namespace std;
int main()
{
  list&lt;int&gt; feld;
  for (int tmpVal; cin &gt;&gt; tmpVal; /* */)
    feld.push_back(tmpVal);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1987059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1987059</guid><dc:creator><![CDATA[Unmöglich]]></dc:creator><pubDate>Sun, 28 Nov 2010 14:43:47 GMT</pubDate></item></channel></rss>