+ 2

What is the "-->" operator in c++?

I don't get it so i ask .

8th May 2020, 7:29 AM
Prince Arman
Prince Arman - avatar
2 ответов
+ 1
Hello Prince. '--> is not an operator. It is instead the combination of two operators which are '--' (decrement) and '>' (greater than). Consider the following example : int a = 5; int b = 6; printf(b-->a ? "true" : "false"); // true Because 'b--' is 5 but it doesn’t change the main value of b. So 6 is compared with 5. And as 6 is greater than 5 it returns true.
8th May 2020, 8:42 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
Thanks
8th May 2020, 9:30 AM
Prince Arman
Prince Arman - avatar