Hello, I'm having some trouble with my homework assignment that involves structs. I have the structure here:
1 2 3 4 5 6 7 8 9
struct change {
change ();
int quarters = 25;
int dimes = 10;
int nickels = 5;
int pennies = 1;
};
The problem however, is that I was instructed to add a function:
change ComputeChange(int cents)
I wrote the function(see below), but I don't know what to return. I've tried 0 and 1, cents, void, change, and chng.quarters. Here is the rest of the function:
I see. I'm not really sure how or where I should define this. I tried to define it by copying the line to the line below and putting the variables inside the parentheses, but I still get the same error.
///////////////////////////
I just removed the constructor and it runs perfectly. Thank you.