<?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[&#x27;zahl&#x27; declared as reference but not initializied]]></title><description><![CDATA[<p>Hallo Leute,<br />
ich bin ein Anfänger was C/C++ angeht und hoffe Ihr nehmt mir mein kleines Problem nicht zu übel. Wie aus dem Titel entnehmend habe ich einen Error: 'zahl' declared as reference but not initialized</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;

void eingabe(double* z);

int main(int argc, char **argv) {

	int Spiel1[5];
	int lauf = 0;
	double &amp;zahl;

	for (lauf = 0; lauf &lt;= 6; lauf++) {
		Spiel1[lauf] = -1;
	}

	cout &lt;&lt; &quot;Hallo, dies ist das Lottoverwaltungsprogramm.\n\n&quot;;

	do {
		double zahl = 6.0;
		eingabe(&amp;zahl); //speichert Adresse
		cout &lt;&lt; zahl;
	} while (zahl &lt;= 1 || zahl &gt;= 50);
}

double eingabe(float *z) {

	*z = *z + *z + *z + *z + *z + *z;
	cout &lt;&lt; *z &lt;&lt; endl; //Wenn man * weglässt, zeigt er die Speicheradresse
	*z = *z % 6;
	cout &lt;&lt; &quot;Das ist Ihre Durchschnittszahl:&quot; &lt;&lt; *z &lt;&lt; endl;

}
</code></pre>
<p>Ich habe vor sechs <strong>beliebige</strong> Zahl einzugeben, habe aber die Zahl 6.0 angegeben, damit ich das Programm erstmal so in Betrieb nehmen kann. Dann habe ich mir überlegt, die Durchschnittszahl errechnen zu lassen, habe aber keinen Plan, ob das so möglich ist, wegen dem geschilderten Error.</p>
<p>Hoffe Ihr könnt mir da fix helfen!</p>
<p>/edit pumuckl: cpp-Tags. Zukünftig bitte selbst machen!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/289356/zahl-declared-as-reference-but-not-initializied</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 05:44:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/289356.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Jul 2011 11:02:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Mon, 04 Jul 2011 07:51:18 GMT]]></title><description><![CDATA[<p>Hallo Leute,<br />
ich bin ein Anfänger was C/C++ angeht und hoffe Ihr nehmt mir mein kleines Problem nicht zu übel. Wie aus dem Titel entnehmend habe ich einen Error: 'zahl' declared as reference but not initialized</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;

void eingabe(double* z);

int main(int argc, char **argv) {

	int Spiel1[5];
	int lauf = 0;
	double &amp;zahl;

	for (lauf = 0; lauf &lt;= 6; lauf++) {
		Spiel1[lauf] = -1;
	}

	cout &lt;&lt; &quot;Hallo, dies ist das Lottoverwaltungsprogramm.\n\n&quot;;

	do {
		double zahl = 6.0;
		eingabe(&amp;zahl); //speichert Adresse
		cout &lt;&lt; zahl;
	} while (zahl &lt;= 1 || zahl &gt;= 50);
}

double eingabe(float *z) {

	*z = *z + *z + *z + *z + *z + *z;
	cout &lt;&lt; *z &lt;&lt; endl; //Wenn man * weglässt, zeigt er die Speicheradresse
	*z = *z % 6;
	cout &lt;&lt; &quot;Das ist Ihre Durchschnittszahl:&quot; &lt;&lt; *z &lt;&lt; endl;

}
</code></pre>
<p>Ich habe vor sechs <strong>beliebige</strong> Zahl einzugeben, habe aber die Zahl 6.0 angegeben, damit ich das Programm erstmal so in Betrieb nehmen kann. Dann habe ich mir überlegt, die Durchschnittszahl errechnen zu lassen, habe aber keinen Plan, ob das so möglich ist, wegen dem geschilderten Error.</p>
<p>Hoffe Ihr könnt mir da fix helfen!</p>
<p>/edit pumuckl: cpp-Tags. Zukünftig bitte selbst machen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088064</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Mon, 04 Jul 2011 07:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 11:26:31 GMT]]></title><description><![CDATA[<p>Warum deklarierst du</p>
<pre><code class="language-cpp">double &amp;zahl;
</code></pre>
<p>als Referenz?</p>
<p>Ich habe den Code nicht ganz genau angesehen (weil kaum lesbar, da keine cpp Tags), aber möchtest du da nicht eine &quot;normale&quot; Variable haben:</p>
<pre><code class="language-cpp">double zahl;
</code></pre>
<p>*Edit<br />
Du bist übrigens noch im falschen Unterforum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088072</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Sun, 03 Jul 2011 11:26:31 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 11:30:41 GMT]]></title><description><![CDATA[<p>Ich arbeite immer an dem &quot;je weniger Errors - desto besser - Prinzip&quot;. Wenn ich double &amp;zahl; zu double zahl; ändere gibt er mir nur weitere Fehlermeldungen</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;

void eingabe(double* z);

int main(int argc, char **argv) {

	int Spiel1[5];
	int lauf = 0;
	double zahl;

	for (lauf = 0; lauf &lt;= 6; lauf++) {
		Spiel1[lauf] = -1;
	}

	cout &lt;&lt; &quot;Hallo, dies ist das Lottoverwaltungsprogramm.\n\n&quot;;

	do {
		double zahl = 6.0;
		eingabe(&amp;zahl); //speichert Adresse
		cout &lt;&lt; zahl;
	} while (zahl &lt;= 1 || zahl &gt;= 50);
}

double eingabe(float *z) {

	*z = *z + *z + *z + *z + *z + *z;
	cout &lt;&lt; *z &lt;&lt; endl; //Wenn man * weglässt, zeigt er die Speicheradresse
	*z = *z % 6;
	cout &lt;&lt; &quot;Das ist Ihre Durchschnittszahl:&quot; &lt;&lt; *z &lt;&lt; endl;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2088074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088074</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 11:30:41 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 11:32:57 GMT]]></title><description><![CDATA[<p>kann das hier jemanden dann bitte verschieben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088077</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 11:32:57 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 11:52:41 GMT]]></title><description><![CDATA[<p>Gast192 schrieb:</p>
<blockquote>
<p>Ich arbeite immer an dem &quot;je weniger Errors - desto besser - Prinzip&quot;.</p>
</blockquote>
<p>Ganz schlechtes Prinzip. Der Compiler kann nämlich nur Syntax überprüfen, aber nicht die Semantik deines Programms.</p>
<p>Das Problem ist, dass ich deinen Code überhaupt nicht verstehe. Du deklarierst z.B. die Funktion eingabe als void, implementierst sie dann aber mit double-Rückgabewert, gibst aber nichts zurück.</p>
<p>Hier mal etwas Code, wie die Eingabe einer Zahl in etwa aussehen könnte (ohne komplizierte Pointer und Referenzen):</p>
<pre><code class="language-cpp">double eingabe(); 

int main(int argc, char **argv) { 
	int input;
    input = eingabe();
	cout &lt;&lt; input &lt;&lt; endl;
} 

double eingabe() { 
	double z;
	cin &gt;&gt; z; // Hier wird die Eingabe gelesen und in z gespeichert
	return z; // Eingabe wird zurückgegeben
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2088084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088084</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Sun, 03 Jul 2011 11:52:41 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 12:03:11 GMT]]></title><description><![CDATA[<p>Ich würde es aber gerne mit Referenzen machen, weil mir das noch nicht so gut liegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088088</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 12:03:11 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 12:08:48 GMT]]></title><description><![CDATA[<p>Dann hier mit Referenzen:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt; 
#include &lt;cstdlib&gt; 
using namespace std; 

void eingabe(double &amp; zahl); 

int main(int argc, char **argv) 
{ 
	double input;
    eingabe(input);
	cout &lt;&lt; input &lt;&lt; endl;
} 

void eingabe(double &amp; zahl) 
{ 
	cin &gt;&gt; zahl; // Hier wird die Eingabe gelesen und in z gespeichert
	zahl *= 6; // Hier kannst du mit der Zahl rechen oder was auch immer
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2088093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088093</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Sun, 03 Jul 2011 12:08:48 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 13:15:50 GMT]]></title><description><![CDATA[<p>Danke dir bis hierhin!<br />
Bekomm es aber noch nicht hin statt der 6 eine andere Zahl die ich eingeben kann da ausrechnen zu lassen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088132</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 13:15:50 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 14:41:54 GMT]]></title><description><![CDATA[<p>Gast192 schrieb:</p>
<blockquote>
<p>Danke dir bis hierhin!<br />
Bekomm es aber noch nicht hin statt der 6 eine andere Zahl die ich eingeben kann da ausrechnen zu lassen</p>
</blockquote>
<p>Bin mir nicht ganz sicher was du meinst. Zeig mal den Code, den du bis jetzt hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088184</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Sun, 03 Jul 2011 14:41:54 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 15:04:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt; 
#include &lt;cstdlib&gt; 
using namespace std; 

void eingabe(double &amp; zahl); 

int main(int argc, char **argv) 
{ 
    double input; 
    eingabe(input); 
    cout &lt;&lt; input &lt;&lt; endl;
    //*1 evtl hier die zweite Eingabe machen
} 

void eingabe(double &amp; zahl) 
{ 
    cin &gt;&gt; zahl; // Hier wird die Eingabe gelesen und in z gespeichert 
    zahl *= 6; //*1 und hier statt mit der 6 mit der eingegebenen Zahl multiplizieren
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2088195</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088195</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 15:04:22 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 15:11:28 GMT]]></title><description><![CDATA[<p>Die Frage ist nun, woher die zusätzliche Zahl kommt.</p>
<p>Du kannst sie an die Funktion übergeben, dann sieht die Funktion so aus:</p>
<pre><code class="language-cpp">void eingabe(double &amp; zahl, double zahl_2) 
{ 
    cin &gt;&gt; zahl; // Hier wird die Eingabe gelesen und in z gespeichert 
    zahl *= zahl_2; //*1 und hier statt mit der 6 mit der eingegebenen Zahl multiplizieren
}
</code></pre>
<p>Du kannst aber auch die Zahl in der Funktion selber einlesen:</p>
<pre><code class="language-cpp">void eingabe(double &amp; zahl) 
{ 
	double zahl_2;
	cin &gt;&gt; zahl_2;
    cin &gt;&gt; zahl; // Hier wird die Eingabe gelesen und in z gespeichert 
    zahl *= zahl_2; //*1 und hier statt mit der 6 mit der eingegebenen Zahl multiplizieren
}
</code></pre>
<p>Kannst dir eine der beiden Versionen aussuchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088199</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Sun, 03 Jul 2011 15:11:28 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 18:30:46 GMT]]></title><description><![CDATA[<p>Auch danke hierfür :p</p>
<p>bisher kann ich nur 3 Zahlen eingeben. Wenn ich die Funktion am Schluss ändere und vervielfache, werden nur die letzten beiden Zahlen multipliziert. Wie kann ich also z. B. statt nur 2 Zahlen einzugeben 3 Zahlen eingeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088314</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 18:30:46 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 18:31:35 GMT]]></title><description><![CDATA[<p>nur *2 Zahlen eingeben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088315</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 18:31:35 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 18:35:24 GMT]]></title><description><![CDATA[<p>Gegenfrage: Was genau hast du eigentlich vor?</p>
<p>Wenn du mehrere Zahlen nach einem festgelegten Muster einlesen und verarbeiten willst, dann kannst du deine Funktion schreiben, daß sie genau das erledigt. Ansonsten könntest du es auch mit Schleifen und/oder Arrays probieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088316</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sun, 03 Jul 2011 18:35:24 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 18:48:06 GMT]]></title><description><![CDATA[<p>Ich denke mal ich will einen Zeiger für Arrays wäre da besser, damit ich nicht jeden Wert deklarieren muss, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088322</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Sun, 03 Jul 2011 18:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 19:02:26 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/u18363" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/f58" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/f15" rel="nofollow">C++ (auch C++0x)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088331</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 03 Jul 2011 19:02:26 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Sun, 03 Jul 2011 20:28:18 GMT]]></title><description><![CDATA[<p>Gast192 schrieb:</p>
<blockquote>
<p>Ich denke mal ich will einen Zeiger für Arrays wäre da besser, damit ich nicht jeden Wert deklarieren muss, oder?</p>
</blockquote>
<p>In deinem ersten posting dieses threads steht, dass du 6 Zahlen eingeben und dann den Durchschnittswert berechnen möchtest.<br />
Wie du eine Zahl einliest weisst du ja mitlerweile.<br />
Nun musst du dir doch nur noch überlegen wie du 6 Zahlen einliest (Stichwort: schleife).</p>
<p>Den Durchschnitt zu berechnen sollte dann doch kein Problem mehr sein oder?</p>
<p>Welches Problem hast du nun bei der Umsetzung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088385</guid><dc:creator><![CDATA[inter2k3]]></dc:creator><pubDate>Sun, 03 Jul 2011 20:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Mon, 04 Jul 2011 10:38:38 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;

void eingabe(double &amp; zahl);

int main(int argc, char **argv) {
	for (int lauf = 0; lauf &lt;= 6; lauf++) {
		double input;
		eingabe(input);
		cout &lt;&lt; input &lt;&lt; endl;
	}
	while (input &gt;= 1 || input &lt;= 49)
		;
}

void eingabe(double &amp; zahl) {
	double zahl[4];
	cin &gt;&gt; zahl[4];
	cin &gt;&gt; zahl; // Hier wird die Eingabe gelesen und in z gespeichert
}
</code></pre>
<p>Das ist mein bisheriger Code. Nur zeigt er mir wieder Fehlermeldungen:<br />
line 13: 'input' was not declared in this scope<br />
line 18: declaration of 'double zahl[4]' shadows a parameter<br />
line 20: no match for 'opderator&gt;&gt;'std::cin&gt;&gt;zahl'</p>
<p>Wie ihr sehen könnt habe ich ebenfalls ein Zahlenbereich gesetzt, welchen ich gern beibehalten würde</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088576</guid><dc:creator><![CDATA[Gast192]]></dc:creator><pubDate>Mon, 04 Jul 2011 10:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to &#x27;zahl&#x27; declared as reference but not initializied on Mon, 04 Jul 2011 11:17:28 GMT]]></title><description><![CDATA[<p>line 13: 'input' was not declared in this scope<br />
Schau dir mal das hier an:</p>
<pre><code class="language-cpp">for (int lauf = 0; lauf &lt;= 6; lauf++) {
		double input;
		eingabe(input);
		cout &lt;&lt; input &lt;&lt; endl;
	}
	while (input &gt;= 1 || input &lt;= 49)
		;
</code></pre>
<p>Hier wird <em>in der Schleife</em> die Variable input definiert, die nach der Schleife nicht mehr existiert, und daher kann auch nicht drauf zugegriffen werden.</p>
<p>line 18: declaration of 'double zahl[4]' shadows a parameter</p>
<pre><code class="language-cpp">void eingabe(double &amp; zahl) { //(1)
    double zahl[4];   //(2)
    cin &gt;&gt; zahl[4];   //(3)
    cin &gt;&gt; zahl; //(4)
}
</code></pre>
<p>Hier definierst du an Stelle (2) ein double-Array mit Namen &quot;zahl&quot;. Das ist eine andere Variable als der Parameter &quot;zahl&quot;, den du an (1) definiert hast. Der ist deshalb nicht mehr sichtbar in der Funktion.<br />
Was du an (3) machst ist sicher nicht das, was du glaubst zu tun (wobei ich mir nicht sicher bin <em>was</em> du überhaupt glaubst zu tun): hier wird die Zahl an der <strong>5ten Stelle des Arrays</strong> eingelesen. Dummerweise hat dein Array nur 4 Elemente, daher erzeugt das hier undefiniertes Verhalten.<br />
An (4) meckert der Compiler, weil du nicht in die Referenz aus (1) einliest, sondern in einen Pointer auf das Array, das du in (2) defniiert hast. (Die Definition von (1) ist ja versteckt worden). Und um einen Pointer auf double einzulesen gibts keinen passenden operator&gt;&gt;, daher die Fehlermeldung.</p>
<p>Ich würde dir dringend raten, nochmal gründlich die ersten Kapitel im C++-Buch deiner Wahl durchzuarbeiten, es scheint als hättest du da einige Grundlagen noch nicht ganz verinnerlicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2088593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2088593</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 04 Jul 2011 11:17:28 GMT</pubDate></item></channel></rss>