I have been working on an invoicing program for homework that must use the += operator. I have a function
void GetFee()
{
grandtotal+=totalcharge;
}
When calling the value from the main funtion though, I always get -9.25596e+061 or -1.#INF
I have also tried calling the value within the GetFee function but it always come up with the -9 number.
Sorry if this is a noob question, but it is driving me nuts.
int GetFee(int grandtotal,int totalcharge)
{
return grandtotal+totalcharge;
}
And use them somehow like this:
1 2 3
int fee=GetFee(87,12); //two integer values as parameters, another int will be returned and written into fee.
std::cout<<"The fee is "<<fee<<std::endl; //output would be 'The fee is 99'