in C Plus Plus by
What is the “-->” operator in C++?

1 Answer

0 votes
by

--> is not an operator. It is in fact two separate operators, -- and >.

The conditional's code decrements x, while returning x's original (not decremented) value, and then compares the original value with 0 using the > operator.

To better understand, the statement could be written as follows:

while( (x--) > 0 )

Related questions

+1 vote
asked Jan 20, 2021 in C Plus Plus by SakshiSharma
+1 vote
asked Jan 2, 2020 in C Plus Plus by GeorgeBell
0 votes
asked Jan 24, 2021 in JAVA by rajeshsharma
+1 vote
asked Jan 20, 2021 in C Plus Plus by SakshiSharma
...