+ 3
How many arguments can you pass to an overloaded binary operator .. and why ??
2 Respostas
+ 4
2 arguments, for example:
if you overload the operator = to equal arrays, you could still use it with normal variables.
first argument -> normal variables -> int x = y;
second argument -> arrays -> int array[5] = array2[5];
+ 2
for any binary operator like +,-,*,/,%,= etc you need two operators to work on. So,we need to pass two operands as arguments either implicitly or explicitly.