InterviewSolution
Saved Bookmarks
| 1. |
Is It Possible To Provide Default Values While Overloading A Binary Operator? |
|
Answer» Answer :No!. This is because even if we provide the default ARGUMENTS to the PARAMETERS of the overloaded operator function we would end up USING the binary operator incorrectly. This is explained in the following example: sample operator + ( sample a, sample b = sample (2, 3.5f ) ) { } VOID main( ) { sample s1, s2, s3 ; s3 = s1 + ; // ERROR } |
|