I have a virtual function:
virtual void set_num(double number = 56.00);
I also have a function get_num().
In the virtual function, if a value is greater than 100, I have to set it to 100.
If I dont specify a value, I dont get the default 56.00 printed, and if I put a number over 100, it doesnt output 100.Code:set_num(double number) { if (number > 100.0) { number1 = 100.0; // number1 is a private instance method } }
Thanks