|
From: metalseb <met...@fr...> - 2002-09-18 10:27:17
|
> // ThirdNumber Function
> int ThirdNumber(int NumberThree)
> {
> NumberThree = int NumberOne - int NumberTwo;
> cout << "You have spent $" << NumberThree << " dollars today " << endl;
> }
The compiler doesn't know what to do with this code gathering two declarations of int vars
minusing themselves at the same time. Remove that line.
Remember that NumberOne and NumberTwo are not global vars so they are not known inside
the ThirdNumber function. Only in the main section, where they are declared. By the way,
remove the int return values of each function since they don't do anything but asking for a user
input.
All you have to do in the main section is :
ThirdNumber(NumberTwo-NumberOne);
And in the ThirdNumber func :
void ThirdNumber(int NumberThree)
{
cout << "You have spent $" << NumberThree << " dollars today " << endl;
}
Kind regards
--
Seb
|