Image

Imagesantafegrrl wrote in Imagecpp

calculator program help...

I'm trying to write a simple calculator program that uses functions. I keep getting an error that says "local fucntion definitions are illegal". Can anyone help me through this? This is just a portion of the code...trying to actually get this function to work before I add anything else.

Thanks!



#include
#include
#include
#include

using namespace std;

main()
{

int int1;
int int2;
char choice;
void Multiply( int& );



cout << "This program will add, subtract, multiply, and divide two integers." << endl;
cout << endl;
cout << " +++++++ ------- xxxxxxx /////// +++++++ ------- xxxxxxx /////// " << endl;
cout << endl << endl;
cout << "Let's begin!" << endl;

cout << "****************************" << endl;
cout << "*Enter A for addition *" << endl;
cout << "*Enter S for subtraction *" << endl;
cout << "*Enter M for multiplication*" << endl;
cout << "*Enter D for division *" << endl;
cout << "*Enter Q to quit *" << endl;
cout << "****************************" << endl;
cout << endl << endl << endl;

cout << "What is your choice? : ";
cin >> choice;

if(choice == 'A' || choice == 'a')
{
int1 = 0;
int2 = 0;
Multiply(int1);
}


// ***************Multiply integers funtion******************//
void Multiply( int& one )
{
cout << "Please enter the first integer :" << endl;
cin >> one;
cout << "Please enter the second integer :" << endl;




}



return 0;
}