cout << "press any key to continue....\n";
Well I have no idea what it is you are trying to achieve with any of the code you have posted. You need to post all your code for it to make sense. But I have made some modifications to what is there that I think may help. Hopefully what is there is correct, been a while since I used some of these things. For strcmp to work #include <string.h>
cin >> direction;
if (!(strcmp(direction,"r")) || !(strcmp(direction,"R")))
Also, I changed exit to gameexit as there is already a function exit(0) which will quit your program.
Hope this helps.