for the following:
( a != b ) ? cout<<'not equal' : cout<<'equal';
suppose I don’t care if it’s equal, how can I use the above statement by substituting cout<<'equal' with a no-op.
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.
If it really is for a ternary operator that doesn’t need a second action, the best option would be to replace it for an if:
it will smell a lot less.