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

Submitted 3 years, 4 months ago
Ticket #323
Views 296
Language/Framework Other
Priority Medium
Status Closed

--> operator in c++?

Submitted on Dec 11, 20

i think platform doesnt support C++ as SME is not available at the moment for this language. Lets see any developers could help you on this. - Vengat 3 years, 4 months ago
add a comment

1 Answer

Verified

It is not a single operator. In fact it is two separate operators -- and >.

"--" Operator is decreases the value of a variable by 1

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  --x;
  cout << x;
  return 0;
}

">" operator is greater than 


int main() {
  int x = 3;
  int y = 1;
  cout << (x > y); // returns 1 (true) because 3 is greater than 1
  return 0;
}

Submitted 3 years, 4 months ago


Latest Blogs