Anyone got any ideas on this one?
EDIT:
Oh, and I'm using wxDev-C++ if that makes any difference.
EDITEDIT:
Ah, reading another thread led me to a site that mentioned the answer. I chose 'blank application' when I should have chosen 'console application'.
This leads me to another problem, though, and it will probably help me along the road to find the answer now. I went into the properties dialog for the project and changed the compiler to 'console application', where it was (if I'm not mistaken, I could be doing it wrong) on GUI application. That didn't do anything, though. I had to start a new project and copy/paste the code.
EDITEDITEDIT(heh):
Also, this behavior seems to be inconsistent. I've chose 'blank application' with another example with no problem.
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- float FourFunc(float Num1, float Num2, int Choice)
- {
- float Answer = 0;
- switch(Choice)
- {
- case 1:
- Answer = Num1 + Num2;
- break;
- case 2:
- Answer = Num1 - Num2;
- break;
- case 3:
- Answer = Num1 * Num2;
- break;
- case 4:
- Answer = Num1 / Num2;
- break;
- }
- return Answer;
- }
- int main()
- {
- cout<<"-----------------FourFunc Calc-----------------------\n";
- int Choice;
- float Num1, Num2;
- bool On = 1;
- while (On == 1)
- {
- cout<<"Please choose one of the following options: \n";
- cout<<" 1:Addition\n 2:Subtraction\n 3:Multiplication\n 4:Division\n 5:Quit\n";
- cin>>Choice;
- if (Choice != 5)
- {
- if ((Choice > 0) && (Choice < 6))
- {
- cout<<"Enter number: ";
- cin>>Num1;
- cout<<"\nEnter number: ";
- cin>>Num2;
- cout<<"\nThe answer is: "<< FourFunc(Num1, Num2, Choice);
- }
- else
- {
- cout<<"\nThere seems to have been an Input Error. You might try again.";
- }
- }
- else
- {
- On = 0;
- }
- }
- return 0;
- }