Forum

Einloggen | Registrieren | RSS  

Komische Fehlermeldung (Computertechnik)

verfasst von silent_max(R) E-Mail, 31.03.2012, 16:58 Uhr
(editiert von silent_max am 31.03.2012 um 17:08)

Hallo liebe Gemeinde.

Ich habe folgenden Quellcode geschrieben:

#include
#include
using namespace std;

float Add(float a, float b)
{
cout << endl;
cout << "Addition!" << endl;
cout << "Zwei Zahlen bitte!" << endl;
cin >> a >> b;
float c = a + b;
cout << a << " + " << b << " = " << c << endl;
cout << endl;
return c;
}
float Sub(float d, float e)
{
cout << endl;
cout << "Subtraktion!" << endl;
cout << "Zwei Zahlen bitte!" << endl;
cin >> d >> e;
float f = d - e;
cout << d << " - " << e << " = " << f << endl;
cout << endl;
return f;
}
float Mul(float g, float h)
{
cout << endl;
cout << "Multiplikation!" << endl;
cout << "Zwei Zahlen bitte!" << endl;
cin >> g >> h;
float i = g*h;
cout << g << " * " << h << " = " << i << endl;
cout << endl;
return i;
}
float Div(float j, float k)
{
cout << endl;
cout << "Division!" << endl;
cout << " Zwei Zahlen bitte, jedoch darf der Zähler nicht 0 sein!" << endl;
cin >> j >> k;
float l = j/k ;
cout << j << " / " << k << " = " << l << endl;
cout << endl;
return l;
}

float Wurzel(float m)
{
cout << endl;
cout << "Quadratwurzel!" << endl;
cout << "Eine Zahl bitte!" << endl;
cin >> m;
float n = sqrt (m);
cout << "Ergebnis ist " << n << endl;
cout << endl;
return n;
}

int main()
{
float a,b,c;
float d,e,f;
float g,h,i;
float j,k,l;
float m,n;

cout << "Rechenoperationen!" << endl;

c=Add(a,b);
f=Sub(d,e);
i=Mul(g,h);
l=Div(j,k);
n=Wurzel(m);
return 0;
}

Der Kompiler hat beim Linken keinen Fehler gemeldet. Nachdem ich jedoch auf "Debuggen ohne starten" geklickt habe, kommt folgende Fehlermeldung:




Könnt ihr mir sagen, was ich falsch gemacht habe?

Weil so wie ich die Fehlermeldung kapiert habe, sei die Variable initialisiert, wird aber nicht verwendet. Was aber nicht sein kann, da sie in der Funktion "Addition" verwendet wird.

Danke für die Antworten im Voraus.

Gruß

Max

Edit: Hier ist der Quellcode besser zu lesen:

http://www.c-plusplus.de/forum/p2197349#2197349

--
Where is the madness ...



Gesamter Thread:

Komische Fehlermeldung - silent_max(R), 31.03.2012, 16:58 (Computertechnik)
Komische Fehlermeldung - gast_0815, 31.03.2012, 20:30
Komische Fehlermeldung - silent_max(R), 01.04.2012, 12:01
Komische Fehlermeldung - Björn(R), 01.04.2012, 20:41