i'm having a problem with a switchstatement that uses strings as the argument and it looks something like this
all of the functions are defined it just gives me an error for every line about a constant i'm using microsoft visual studio .net 2003 and visual c++ pro 6.0. if any one has any thoughts they would be apreciated.Code:void Game(Game Info,ifstream &fin) { int b,c; string a; OpenRoom(Info,fin); cin>>a; while (a!="quit" || a!="exit") { switch (a) { case "remove": Remove(Info,fin); break; case "epuip": Equip(Info,fin); break; case "quit": break; case "northwest": Go(Info,fin,5); break; case "southwest": Go(Info,fin,7); break; case "nw": Go(Info,fin,5); break; case "sw": Go(Info,fin,7); break; case "northeast": Go(Info,fin,4); break; case "southeast": Go(Info,fin,6); break; case "ne": Go(Info,fin,4); break; case "se": Go(Info,fin,6); break; case "w": Go(Info,fin,3); break; case "e": Go(Info,fin,2); break; case "s": Go(Info,fin,1); break; case "n": Go(Info,fin,0); break; case "north": Go(Info,fin,0); break; case "east": Go(Info,fin,2); break; case "west": Go(Info,fin,3); break; case "south": Go(Info,fin,1); break; case "pick": cin>>a; switch (a) { case "up": Get(Info,fin); break; case "nose": cout<<"Thats really sick.\n"; break; } break; case "get": Get(Info,fin); break; case "help": cout<<"While this function of the game is not yet complete, it does have a few tips.\n"; break; case "drop": cin>>a; Drop(Info,fin); break; case "save": SaveGame(Info,false); break; case "Loki": Loki(Info); break; case "Dogma": Dogma(Info); break; case "buy": Buy(Info,fin); break; default: Error(24); } } }
Code Tags added by Kermi3



LinkBack URL
About LinkBacks


