Error in Xcode "There is no corresponding function to call" max ""

This is a statement that I am using, but it says that there is no corresponding function to call 'max'

max((used_minutes-Included_Minutes)*extra_charge,0) 

Any help would be appreciated.

EDIT

code

 int used_minutes; const int Included_Minutes = 300;
 double total_charge, extra_charge;
 cout << "Enter the number of phone call minutes: ";
 cin >> used_minutes;
 cout <<"Number of phone call minutes used - included in the base plan: " << min(used_minutes,Included_Minutes) << endl;
 cout <<"Number of phone call minutes used - not included in the base plan: "<< max(used_minutes-Included_Minutes,0) << endl;
 extra_charge = 0.10;
 cout <<"Cost of excess phone call minutes: $"<<fixed << setprecision(2) << max(used_minutes-Included_Minutes)*extra_charge, 0) <<endl;
+4
source share
1 answer

max()requires the first and second arguments to be of the same type. extra_charge is a double that causes the first and second arguments to be of different types. Try:

max((used_minutes-Included_Minutes)*extra_charge,0.0) 
+7
source

Source: https://habr.com/ru/post/1527266/


All Articles