Posts

Showing posts with the label operator-overloading

Operator’s matching [closed]

Operator’s matching [closed] What is the result of 2.5/5 , in c++? If it’s matched to the + operator of double values, it’ll be 0.5 ; if it’s matched to + of integers, It will be 0 . 2.5/5 + 0.5 + 0 What is the rule of matching and hence conversion of the operands, for c++ arithmetic operators? Is it defined or up to different compilers’ choices? This question appears to be off-topic. The users who voted to close gave this specific reason: Please edit your question to provide a Minimal, Complete, and Verifiable example. – Baum mit Augen Jul 1 at 18:16 If it's simple, you should be able to post the code. – Neil Butterworth Jul 1 at 18:18 By tomorrow, unfortunate...