Name: pieisgood 2008-02-09 13:48
Ok... I have been reading a book on programming and some such and I wanted to make a simple function. I am doing it wrong though.
This won't let me refer to "addition" more than once or else the compiler throws a bitch fit. Why is that?
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
char MenuA;
cout << "please enter A for addition: ";
cin >> MenuA;
float x, y, aso;
double addition ();
{
cout << "please enter the first number to be added: ";
cin >> x;
cout << "please enter the second number to be added: ";
cin >> y;
aso = x + y;
cout << "the solution is: " << aso;
}
if ( MenuA == 'A')
{
addition;
}
else if (MenuA != 'A')
{
cout << "you must enter A";
}
return 0;
}
This won't let me refer to "addition" more than once or else the compiler throws a bitch fit. Why is that?
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
char MenuA;
cout << "please enter A for addition: ";
cin >> MenuA;
float x, y, aso;
double addition ();
{
cout << "please enter the first number to be added: ";
cin >> x;
cout << "please enter the second number to be added: ";
cin >> y;
aso = x + y;
cout << "the solution is: " << aso;
}
if ( MenuA == 'A')
{
addition;
}
else if (MenuA != 'A')
{
cout << "you must enter A";
}
return 0;
}