简体   繁体   中英

What is the name for this type of operators: '+=', '-='

Is there a specific name for this type of operators?

Sum += 1;

I've learned it in my first C++ class and used it a ton, but I never knew if there was a name for the short hand.

Is there a specific name for this type of short?

Yes, it's called a compound assignment 1 operator.

According to Source3 the specific ones are called

  • addition assignment
  • subtraction assignment
  • etc. ...

1) Source1 , Source2 , Source3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM