somethings wrong with my code its my first time using void
of coarse its not done but can you tell me why its not working so far?Code:#include <cstdlib> #include <iostream> #include <fstream> #include <string> using namespace std; int main() { int choicemenu; int yes_or_no; void select; struct charops { string name; int lvl; double exp; int att; int def; int mage; int money; }; struct gameops{ void play(); void quit(); void tut(); int nam(); }; cout<<"welcome to destiny \n"; cout<<"where your destiny becomes a vitual reality \n\n\n"; cout<<"please choose an option\n\n\n\n"; cout<<"1. play game"<< endl; cout<<"2. tutorial"<< endl; cout<<"3. credits"<<endl; cout<<"4. quit\n\n\n\n\n\n\n"<<endl; cin.get(); switch( choicemenu ) case 1: cout<<"you have chosen play game\n"; cout<<"wake up...\n"; cin.get(); cout<<"wake up....\n"; cin.get(); cout<<"WAKE UP!!!!!!\n"; cin.get(); cout<<"finally you're awake\n"; cin.get(); cout<<"good morning johnathon\n"; cout<<"that is your name right?\n"; cin.get(); cout<<"y/n\n"; cin>>yes_or_no; if (select == "yes" || select == "Yes" ) { play(); } if (select == "no" || select == "No" ) { nam(); } }
heres the compile log im using dev-c++
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\textrpg.cpp" -o "C:\Dev-Cpp\textrpg.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Dev-Cpp\textrpg.cpp: In function `int main()':
C:\Dev-Cpp\textrpg.cpp:12: error: variable or field `select' declared void
C:\Dev-Cpp\textrpg.cpp:53: error: ISO C++ forbids comparison between pointer and integer
C:\Dev-Cpp\textrpg.cpp:53: error: ISO C++ forbids comparison between pointer and integer
C:\Dev-Cpp\textrpg.cpp:55: error: `play' undeclared (first use this function)
C:\Dev-Cpp\textrpg.cpp:55: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Dev-Cpp\textrpg.cpp:57: error: ISO C++ forbids comparison between pointer and integer
C:\Dev-Cpp\textrpg.cpp:57: error: ISO C++ forbids comparison between pointer and integer
C:\Dev-Cpp\textrpg.cpp:59: error: `nam' undeclared (first use this function)
Execution terminated