Can someone explain how does less than op work in C?
In particular how it works when types of left hand side and right hand side operands are different?
Does it compare them based on type of the first one or the second one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C specifies standard conversions for different types. The rules are a bit complex, but basically the “smaller” type gets temporarily converted to the larger type, So if you compare an int with a char, the char will be converted to an int, for the purposes of the comparison only.