Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

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.

like image 877
joe_04_04 Avatar asked Jan 06 '16 11:01

joe_04_04


1 Answers

Is there a specific name for this type of short?

Yes, it's called a compound assignment1 operator.

According to Source3 the specific ones are called

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

1)Source1, Source2, Source3

like image 51
πάντα ῥεῖ Avatar answered Oct 20 '22 21:10

πάντα ῥεῖ