There's something left in the input stream. See the FAQ: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
There's something left in the input stream. See the FAQ: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I added a cin.ignore(); with a cin.get();. I also had to delete the return 0;, in order to freeze the frame. Anyways it worked, it compiled to add variable 1 and variable 2.
>> I also had to delete the return 0;
You don't have to delete it, although it is ok if you do. If you have it there, it should be the last thing in the main function, because it signals the end of that function, and therefore the end of your program. Any code after it won't get executed.
well i dont claim to be an expert buuut..why did you make axe a char? wouldnt it make more sense to make it unsigned int?
Probably because the maximum value it would need to hold would be 100 (100% damage, ouch), and a char can do that.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.