I want it to get direction from user, and then add 1 to int xco if the direction was north. I had it semi-working before it would either display zero or some random number. Now it gets the if statement you typ in n and it terminates.
Its making me mad. Then of course there is probably dumb reason it won't work or an if statment won't go there.Its making me mad. Then of course there is probably dumb reason it won't work or an if statment won't go there.Code:#include <cstdlib> #include <iostream> #include <ctime> using namespace std; void to() //first territory { cout<<"You can move south or east. type h for help."; } int main(int argc, char *argv[]) { char namen[100]; int initial; int strength; int agility; int defense; char command; char direction; char n; int xco=0;"; to(); for(int loop=0;loop<100;loop++){ //main loop cin>>command; switch(command){ case 'm': //movement cout<<"which way would you like to move?"; cin>>direction; if (direction=n) return xco+1; cout<<xco; //for test break; break; default: cout<<"messed"; break; } } system("PAUSE"); return EXIT_SUCCESS; }