Oki doke, I'll bang my head against it for a bit more and complain if I get a headache :) Thanks for the help!
Oki doke, I'll bang my head against it for a bit more and complain if I get a headache :) Thanks for the help!
When you say portable I assume you mean compiling with g++ pretty much guarantees non-compiling with, for instance, Visual C++ ?
http://www.daniweb.com/techtalkforums/announcement8-2.html
I got three finals on the same day too, so I feel your pain, but you gotta at least put some effort into it. Not to mention if your teacher is smart he/she is using plagiarism detection software and having someone else code your programs for you could get you in to VERY BIG trouble...
A suggestion completely unrelated to your question:
Lookup and use the switch statement, it accomplishes what you're doing with all those if/else statements but minus the headache you get from looking at it :)
http://www.google.com/search?hl=en&q=switch%28%29+C%2B%2B&btnG=Google+Search
I have many of them :) At this point I'm looking for help with a specific idea I know is possible, I just have no idea how to pull it off
first some code:
cout << "Would you like to continue? (Y/N);
method1();
while(someSentinal)
{
//Do stuff
method2();
//Do more stuff
}
Now let's define what I want from the methods:
method1 - A simple method that accepts one character, as soon as it is hit, without waiting for a newline (or "return") and lets me send it to a char variable to check with, for instance, an if statement.
method2 - A method that checks for a character and allows it to be returned and acted upon in the Do more stuff section. If nothing is there it does different stuff in the do more stuff. Possibly used in a game situation for a real time combat system to check for user input and then go on to calculate some computer player actions.
I'm not too sure if I explained what I want adequately. It makes perfect sense in my head, and I'm sure these methods exist in standard libraries somewhere, I just don't know where.
Thanks for any time you may waste looking at this :)