0
Default Arguments' value
I wanna make a basic " calculator " programm in c++ that '+' be default value for operand if operand be empety and if it wasnt empety do other '-' '×' '÷' I will be grateful if you guide me.
1 ответ
+ 2
simply create a function for calculater with three arguments
e.g void calc(int num1,num2,op='+')
now if you pass it op another then + then it will do that operation,otherwise by default it will compute addition.