I'm doing classes for my assignment and the example we were given did not deal with int's and double's, but the assignment does. I've gotten to the point where I'm defining the class but I don't know how to define the int's and double's in the arguments. I get the error "C++ default argument of type is incompatible with parameter of type". I'm not sure how or what I should put to fix the error.
Since you did not include the whole error message I am guessing that it might refer to this: void setType(string type); and bool isAccType(string type) const;. Although "type" is not a reserved keyword it may still be causing a problem.
So unless the problem is where you defined the functions, i.e., the forward declaration in the class does not match the function definition, it is hard to say because what is in the class looks OK right now.
It is best to include enough of the program that can be compiled.
I have absolutely no clue, that's why I'm asking for help. What do you mean by hold? I know that the the range of an int is +-2147483647 if thats what you mean. If I left it as (int num) I would just get the error "default argument not at end of parameter list"
You know that (int num = "") is wrong, so what does an int hold?
An int holds a whole number whereas a "double" holds a floating point number.
Your code: bankAccount(string name = "", string type = "", int num = "", double bal = "", double rate = ""); is designed to set a default value for the variables, so what default value do you need for the "int" and "double"s?
If I left it as (int num) I would just get the error "default argument not at end of parameter list"
. When using default values they work from right to left. The last variable must have a default before you can give the next to last a default value. and do on. And if the first parameter needs a default value then all parameters must have a default value.