Ich habe noch immer die Testversion auf meiner Festplatte von Heiko KALISTA und habe mir irgendwie ein Problem eingefangen. Ich habe diesen Quellcode kompiliert:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// C++ für Spieleprogrammierer
// Programm 1_1
// Das Menü erstellen
//
#include <iostream>
using namespace std;
// Das Menü
//
int main ()
{
// Varialen
//
char chAuswahl;
int Auswahl = 0; // Ohne diese Variable kann ich nichts im Menü wählen
while (Auswahl == 4)
{
cout << "Menue" << endl;
cout << "======" << endl;
cout << "1) Intro" << endl;
cout << "2) Spielen" << endl;
cout << "3) Spieloptionen" << endl;
cout << "4) Ende" << endl;
cout << "Deine Wahl: ";
cin >> Auswahl;
cout << endl;
if (Auswahl == 1)
cout << "\a\a\a\a\a\a\a\a\a\a";
cout << "Intro wurde abgespielt" << endl;
if (Auswahl == 2)
cout << "(E)inzelspieler oder (M)ultiplayer? ";
cin >> chAuswahl;
if (chAuswahl == 'e')
cout << "Du spielst gegen den Computer." << endl;
else if (chAuswahl == 'm')
cout << "(J)eder gegen jeden oder (T)eamspiel? ";
cin >> chAuswahl;
if (chAuswahl == 'j')
cout << "Jeder gegen jeden." << endl;
else if (chAuswahl == 't')
cout << "Du spielst im Team." << endl;
else
cout << "Falsche Eingabe." << endl;
if (Auswahl == 3)
cout << "Name aendern: ";
cin >> chAuswahl;
cout << "Name wurde erfolgreich geaendert." << endl;
if (Auswahl == 4)
cout << "Programm wird beendet. Bye!";
cout << "\n\n\n";
}
return 0;
}
|
Dann erscheint diese Nachricht:
|
Quellcode
|
1
2
3
4
5
6
7
|
Temporäre Dateien und Ausgabedateien für "Programm 1_1 - Win32 Debug" werden gelöscht.
--------------------Konfiguration: Programm 1_1 - Win32 Debug--------------------
Kompilierung läuft...
Programm 1_1.cpp
Linker-Vorgang läuft...
Programm 1_1.exe - 0 Fehler, 0 Warnung(en)
|
Also ist ja alles in Ordnung. Ich drücke auf '
Ausführen von Programm 1_1.exe Strg+F5' und das kommt dabei raus:
|
Quellcode
|
1
|
Press any key to continue_
|
Da ist doch etwas nicht normal, oder liegt das beim Code?