<?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[Arrays]]></title><description><![CDATA[<p>Ich soll folgendes programmieren:</p>
<p>Punkte: 1<br />
Schreiben Sie ein Programm, welches zunächst die Werte x_min, x_max und x_delta einliest. Nun sollen die Werte der Funktion f(x) = x*sin(x) im Intervall [x_min;x_max] mit dem Abstand x_delta berechnet und in einem Array abgespeichert werden. Beachten Sie, dass das Array exakt die Größe haben soll, die es haben muss, um die Werte zu speichern.</p>
<p>Hab jedoch kaum Ahnung, vorerst siehts wiefolgt aus:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;math.h&gt;
using namespace std;
int main()
{
const int N= 11;
int y[N]= {0};
intx = 0;
for(x=0;x&lt;N;x++)
{
x=y*sin(x);
}
for(x=0;x&lt;N;x++)
{
cout &lt;&lt; setw(3) &lt;&lt; y[x] &lt;&lt; &quot; &quot;;
}
return
  cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; &quot;Programmende!&quot;;
  cin.get();cin.get();
  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/263781/arrays</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 14:32:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/263781.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Mar 2010 13:22:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Arrays on Fri, 26 Mar 2010 13:22:24 GMT]]></title><description><![CDATA[<p>Ich soll folgendes programmieren:</p>
<p>Punkte: 1<br />
Schreiben Sie ein Programm, welches zunächst die Werte x_min, x_max und x_delta einliest. Nun sollen die Werte der Funktion f(x) = x*sin(x) im Intervall [x_min;x_max] mit dem Abstand x_delta berechnet und in einem Array abgespeichert werden. Beachten Sie, dass das Array exakt die Größe haben soll, die es haben muss, um die Werte zu speichern.</p>
<p>Hab jedoch kaum Ahnung, vorerst siehts wiefolgt aus:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;math.h&gt;
using namespace std;
int main()
{
const int N= 11;
int y[N]= {0};
intx = 0;
for(x=0;x&lt;N;x++)
{
x=y*sin(x);
}
for(x=0;x&lt;N;x++)
{
cout &lt;&lt; setw(3) &lt;&lt; y[x] &lt;&lt; &quot; &quot;;
}
return
  cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; &quot;Programmende!&quot;;
  cin.get();cin.get();
  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1874182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1874182</guid><dc:creator><![CDATA[boenz666]]></dc:creator><pubDate>Fri, 26 Mar 2010 13:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Arrays on Fri, 26 Mar 2010 13:28:57 GMT]]></title><description><![CDATA[<p>Und wie ist deine Frage?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1874187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1874187</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 26 Mar 2010 13:28:57 GMT</pubDate></item><item><title><![CDATA[Reply to Arrays on Fri, 26 Mar 2010 13:29:55 GMT]]></title><description><![CDATA[<p>Ich hab jetzt weiter garbeitet und es sieht jetzt so aus, aber ich kriege es nicht zum Laufen?</p>
<p>[/cpp]#include &lt;iostream&gt;<br />
#include &lt;iomanip&gt;<br />
#include &lt;math.h&gt;<br />
using namespace std;<br />
int main()<br />
{<br />
double Max=0;<br />
double Min=0;<br />
double Delta=0<br />
const int N = 11;<br />
int y[N] = {0};<br />
int x = 0;</p>
<p>cout &lt;&lt; &quot;Geben sie nun x_min ein: &quot;;<br />
cin &gt;&gt; Min;<br />
cout &lt;&lt; &quot;Geben sie nun x_max ein: &quot;;<br />
cin &gt;&gt; Max;<br />
cout &lt;&lt; &quot;Geben sie nun x_delta ein: &quot;;<br />
cin &gt;&gt; Delta;</p>
<p>for(x=0;x&lt;N;x++)<br />
{<br />
x=y*sin(x);<br />
}<br />
for(x=0;x&lt;N;x++)<br />
{<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox127098" checked="true" /><label for="checkbox127098">&lt;&lt; &quot; &quot;;</label></div><br />
}<br />
return<br />
cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; &quot;Programmende!&quot;;<br />
cin.get();cin.get();<br />
return 0;<br />
}<br />
[cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1874188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1874188</guid><dc:creator><![CDATA[boenz666]]></dc:creator><pubDate>Fri, 26 Mar 2010 13:29:55 GMT</pubDate></item><item><title><![CDATA[Reply to Arrays on Fri, 26 Mar 2010 13:43:08 GMT]]></title><description><![CDATA[<p>Du hast z.B. schon mal ein Semikolon vergessen (das sollte dir der Compiler auch sagen):</p>
<pre><code class="language-cpp">double Delta=0
</code></pre>
<p>Wenn du hier fehlerhaften Code postest, musst du auch immer die Fehlermeldungen mitliefern!</p>
<p>EDIT: Und beim Aufruf von sin() solltest du x casten nach float oder double, sonst weiß der Compiler nicht, welche Überladung er wählen soll.</p>
<p>EDIT2: Und du kannst einen Wert nicht mit einem Array multiplizieren...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1874194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1874194</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 26 Mar 2010 13:43:08 GMT</pubDate></item><item><title><![CDATA[Reply to Arrays on Fri, 26 Mar 2010 13:43:56 GMT]]></title><description><![CDATA[<p>Hi Matze hab die beiden Fehler gefunden.<br />
Danke wegen dem Tip, hab ich total übersehen und nächstes Mal liefere ich die Fehlerberichte dann dazu;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1874196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1874196</guid><dc:creator><![CDATA[boenz666]]></dc:creator><pubDate>Fri, 26 Mar 2010 13:43:56 GMT</pubDate></item></channel></rss>