Code: a<=b?cout<<"a is less then b":cout<<"b is less then a"; Can also be written as: Code: if(a<=b) { cout<<"a is less then or equal to b"; } else { cout<<"b is less then a"; } I use it to shorten stuff up
Originally Posted by systemfiles Learn C++ get a book for it or read tutorials. Yeh that was a lot of help system >_>... Anyway its what HD said. Just a shortened version of the if else statement... [php]comparison1 < comparison2 ? Execute_If_True : Execute_If_False;[/php]
Originally Posted by systemfiles Learn C++ get a book for it or read tutorials. dude i read book but sometimes when i get bored of the chapter i skip some pages and when i got to a code i saw that thing. anyways thx guys i researched online and got it.
Originally Posted by lalakijilp why doesn't this work??? Code: val1<val2?return (val1):return (val2); Try doing it this way. I just realised the shorthand version can only pass a values sort of forgot about that :l. So like this: Code: return (val1<val2) ? val1 : val2;