Answer» Here is my first C++ console app... Very basic... It has an attitude problem so I call it the hasseler.exe program
Code: [SELECT]// THE_Hasseler.cpp #include <iostream> using namespace std; void simon(int); void simon1(int); void TEST(int); void TEST2(int);
int main() { simon(3); cout << "How many times will simon declare next, you dummy?"; int count; cin >> count; simon1(count); cout << "You're on a roll." " Now, tell me how many dinasaurs do you want for Christmas, immediately, or you get nothing."; int variable; cin >> variable; TEST(variable); cout << "If you're so smart, what's 2 x 2?"; int bob; cin >> bob; TEST2(bob);
cin.get(); cin.get(); return 0; }
void simon(int n) { cout << "Simon says TOUCH your toes " << n << " times.\n"; }
void simon1(int n) { cout << "You're right, simon has declared " << n << " times.\n"; }
void TEST(int n) { cout << "Then you shall have " << n << " dinasaurs, just don't EXPECT anything in your stocking.\n"; }
void TEST2(int n) { cout << "You MIGHT be right, but I'm not smart enough to tell yet. HEE HEE"; }
Hi there,
"Attitude problem". Please explain. Copy the code to a C++ compiler and run it in debug mode, and you will see..
When it OPENS up in a console window, it just asks a bunch of silly questions, and after every answer you type (which should be an integer) it will respond and ask another question... There are only 4 questions it asks..Regarding my last user-defined funtion: void TEST2(int n)
It should actually be: void TEST2(), since the output string value contains no "n" variable...
Hm..
When I copy my code off the forum into my compiler it doesn't work
I get an error... How do you copy code into the compiler correctly?
Well, if you can't copy it successfully..
Here is a link from sendspace.comto download the .exe file
http://www.sendspace.com/file/p9csszerrrrr!
Now it seems to be working without any problems, and I can copy and paste without errors.. I feel like an idiot now, with all these excessive posts I can suggest locking the topic though. Quote from: TheUnixGuy on February 21, 2010, 04:29:53 AM I can suggest locking the topic though.
Why?
|