Hey,
wieso bekomme ich ein Error bei der Funktion "GameStart()" ?
Ich kapier das nicht
#Code:
Code
#include <iostream>#include <conio.h>using namespace std;int main(void){ cout << "Game created by Sh12" << "\nHave Fun!"; cout << "\n\n[1/3] Willkommen in Sh12's Game. Bitte gib deinen Namen ein: "; string pname; cin >> pname; cout << "\n\nDu heisst also " << pname << "?" << "\n'Ja/Nein'\n\n"; cin.sync(); string yesno; cin >> yesno; if( yesno == "Ja" || yesno == "ja" ) { ////////////////////////////////////// GameStart(); } if( yesno == "Nein" || yesno == "nein" ) { cout << "\n\n[2/3] Wie ist dein Name?: "; cin >> pname; cout << "\n\nDu heisst also " << pname << "?" << "\n'Ja/Nein'\n\n"; cin >> yesno; if( yesno == "Ja" || yesno == "ja" ) { cout << "\n\nVielen Dank für die Bestätigung!"; GameStart(); } if( yesno == "Nein" || yesno == "nein" ) { cout << "\n\n[3/3] Wie ist dein Name?: "; cin >> pname; cout << "\n\nDein Name ist nun: " << pname; GameStart(); } } cin.sync(); cin.sync(); cin.get(); return 0;}void GameStart(){ cout << "\n\nVielen Dank für die Bestätigung!"; cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\nDas Game ist gestartet!"; cout << "\n\n\t1. Singeplayer"; cout << "\n\t2. Multiplayer (Offline)"; cout << "\n\t3. Multiplayer (Online)"; cout << "\n\t4. Optionen"; cout << "\n\t5. Beenden"; cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; /*char mode; cin >> Mode; switch(Mode) { case '1': { cout << "Der Singleplayer Modus ist gestartet!\n\n\n\n\n"; break; } case '2': { cout << "Der Offline Multiplayer Modus ist gestartet!\n\n\n\n\n"; break; } case '3': { cout << "Der Online Multiplayer Modus ist gestartet!\n\n\n\n\n"; break; } case '4': { cout << "Die Optionen werden ausgeführt!\n\n\n\n\n"; break; } case '5': { cout << "Das Spiel wurde beendet!\n\n\n\n\n"; break; } }*/}
#Errors:
Code
C:\Users\Narushi\Desktop\Dev-Cpp 5.3.0.2 MinGW 4.7.0 Portable\Dev-Cpp\Sh12\Tutorials\sh12.cpp In function 'int main()': 20 13 C:\Users\Narushi\Desktop\Dev-Cpp 5.3.0.2 MinGW 4.7.0 Portable\Dev-Cpp\Sh12\Tutorials\sh12.cpp [Error] 'GameStart' was not declared in this scope 29 14 C:\Users\Narushi\Desktop\Dev-Cpp 5.3.0.2 MinGW 4.7.0 Portable\Dev-Cpp\Sh12\Tutorials\sh12.cpp [Error] 'GameStart' was not declared in this scope 35 14 C:\Users\Narushi\Desktop\Dev-Cpp 5.3.0.2 MinGW 4.7.0 Portable\Dev-Cpp\Sh12\Tutorials\sh12.cpp [Error] 'GameStart' was not declared in this scope