I would like to create a function that allows me to set the temperatures of a thermostat in one or two regions. I would like to set a default value when I declare the function, so that if it's called with only 1 argument, the temperature is the same in both regions, but if I call 2 arguments, they are different in the two regions.
For example :
void set_thermostat(double ref_t1, double ref_t2=ref_t1);
But it seems that this doesn't work like that, since ref_t1 is not declared. I get "identifier "ref_t1" is not defined". How can I create that function ?
Thank you