Can someone please explain to me what does this c++ code snippet mean?
maxlen = (len1 > len2) ? len1 : len2;
I am confused, in general what does the question sign mean along with the statements in between parenthesis. I have seen this a lot and have no clue what it means.© BrainMass Inc. brainmass.com March 21, 2019, 9:30 pm ad1c9bdddf
You can understand it as a compact if-then-else ternary operator "?:" .
In the given case it amounts to writing the following if-then-else ...
In the given case it amounts to writing the following if-then-else statement.