i am trying to make like a text game based on a choose yur own adventure book and i keep getting an error that says
9 C:\Dev-Cpp\madlibgame.cpp
`c' undeclared (first use this function)
here is my code
Code:#include <iostream> #include <string> using namespace std; int main(void) { int whattheytype; string commands = c; int exit; std::cout<<"ok this is a choose your own adventure game called\n"<<endl; std::cout<<"deep space. you will read the page then you will be\n"<<endl; std::cout<<"asked to choose which way you want to go and such\n"<<endl; std::cout<<"sounds like fun huh? thought so. ok type c to\n"<<endl; std::cout<<"get a list of commands. and type exit to leave"<<endl;/* all this is is the introductory for the game*/ std::cin>>whattheytype; if (whattheytype == commands); std::cout<<"eet works!"; else if (whattheytype == 2) std::cout<<"yup\n"; std::cout<<"\npress any key and hit enter to quit:"; std::cin>>exit; return 0; }



LinkBack URL
About LinkBacks


