I was reading some code and found this line:
mil[j+1] = mil[j] <? res[j];
What the "<?" mean? My first guess would be a conditional, like in "a<b?c:d", but the < is a binary operator, so it doesn't make much sense.
Thanks.
I was reading some code and found this line:
mil[j+1] = mil[j] <? res[j];
What the "<?" mean? My first guess would be a conditional, like in "a<b?c:d", but the < is a binary operator, so it doesn't make much sense.
Thanks.
I believe that's shorthand for:
i.e. it returns the lesser of the two values.Code:mil [j + 1] = mil [j] < res [j] ? mil [j] : res [j];
It is a compiler extension for gcc, and is not standard C++. I also think it means exactly what you guessed it means. It's just shorthand.
Interesting, well I certainly learnt something today. I guess >? works too? What about <=? etc?
Of course on most compilers it's what we call a "syntax error".
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
They're all deprecated and may have even be removed in 4.3. I think I remember something to that effect in the changelog.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law