Here is the code block. Can anyone explain what it means to have a pair of numbers enclosed in parentheses. (This is in C ++.)
int a = 2, b = 2, c = 3, d = 1; if((a,b)<(c,d)) cout<<"case1"<<endl; else cout<<"case2";
This is a comma operator; he evaluates the thing on the left, gives the result and returns the result on the right. Since evaluating an int variable has no side effects, if semantically equivalent
int
if
if(b < d)
Or, if the value changes or is accepted as user input, you can use && (s), || (or) logical operators for sorting your codes
&&
||
if ((a<c) && (b<d))
or
if ((a<c) || (b<d))
That way you can do things the way you like. Check here the operators http://www.cplusplus.com/doc/tutorial/operators/
Source: https://habr.com/ru/post/1441173/More articles:connect between java and swi proog - javaHow to turn this into a matrix? - pythonUsing FactoryGirl to create objects with the necessary associations - ruby-on-railsExport embedded code in html in org-mode - emacsIs there a Java equivalent for XmlDocument.LoadXml () from .NET? - javaJenkins notifyCommit trigger not working? - svnRunning window.crypto.getRandomValues () from a web worker - javascriptdifferent between eval (string) and eval (function) - javascriptFunction in C # to call a class / method, as in php - c #Convert a regular xcode application project to iOSOpenDev - iosAll Articles