Hey guys
Here's my code that is giving me a compiler error ?
Why is my darling computer complaining so horribly about what I always do with cin and cout which is give them their respective accessories >> and << ?
Here's the code for the main function:
int main()
{
string description;
int shelfStay;
float wholesalePrice, cashPrice, creditPrice, totalOfDifferences;
// initialise total
totalOfDifferences = 0;
inputAndValidate(description, shelfStay, wholesalePrice);
determinePrices(shelfStay,wholesalePrice, cashPrice, creditPrice);
updateDifference(cashPrice, creditPrice, totalOfDifferences);
cout.setf(ios::fixed);
cout.precision(2);
cout << description << " is expected to stay on the shelf for " << shelfStay << " days and has a wholesale price"
<< endl << " of "
<< "R" << wholesalePrice << endl;
cout << " The cash price for " << description << " is R" << wholesalePrice << endl;
cout << "The total of the difference between the cash and credit" << endl;
[COLOR="red"]cout << " prices is now R " << updateDifference(cashPrice, creditPrice, totalOfDifferences) << endl;[/COLOR]
return 0;
system("pause");
return 0;
}
This is the negativity it gives me:
no match for 'operator<<' in 'std::operator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(&std::cout)), ((const char*)" prices is now R ")) << updateDifference(cashPrice, creditPrice, ((float&)(&totalOfDifferences)))'
I'm using devc++ and I've changed my compiler settings and changed my make to: g++ but that didn't work. My make is now mingw32-make.
Hope you guys can help ;)