The reason you keep getting these errors is that the number of arguments specified in the function prototype does not agree with the number of arguments you are passing into the function and the number of arguments given in the function definition.
Code:
int budgetcalculator(); // Zero arguments defined
...
budget = budgetcalculator(winlose, budget, bet); // Three arguments provided
...
// Three arguments defined
int budgetcalculate(char state, float credit, float moneybet)
{
if(moneybet<=credit)
if(state=='w')
credit += moneybet;
else if(state=='l')
credit -= moneybet;
return credit;
}
The number of arguments in the prototype must agree with how many you pass into the function when you call it later or else the compiler will complain. Also, the return type should be a float. Change your code to this:
Code:
float budgetcalculate(char, float, float);
...
float budgetcalculate(char state, float credit, float moneybet)
{
if(moneybet<=credit)
if(state=='w')
credit += moneybet;
else if(state=='l')
credit -= moneybet;
return credit;
}