Hey guys I am trying to write a program for my computer science and I keep getting an error c2059 on line 6 where I declare char choice1, b,l. I have been trying various things yet I can't get the error to disappear. Also I am using visual studio 2008. Any help would be appreciated, also this is my first post so sorry if I messed anything up.
Code:#include <iostream> using namespace std; int main () { char choice1,'b','l'; cout<< "You are going on a camping trip and decide to stop at a store. You have enough \nmoney for either beef jerky or lighter fluid. So you have to choose one or \nthe other. (b/l)"<<endl; cin>> choice1; if(choice1== 'b') { cout<< "You have decided to buy the beef jerky and continue to the campground."<<endl; } else if(choice1=='l') { cout<< " You have decided to buy the beef jerky and continue to the campground."<<endl; } else { cout<< "Invalid response please try again."<<endl; } system("PAUSE"); return 0; }



LinkBack URL
About LinkBacks


