what does this symbol mean in c++

hi, i have come across some sample code and would just like to know what this means?

declared as
int f1=0

then
f1+=1

what is the += doing?

thanks in advance
kipl20Asked:
Who is Participating?
 
evilrixConnect With a Mentor Senior Software Engineer (Avast)Commented:
The += mean add the value on the right to the variable on the left. In this case f1 will end up having a value of one after the += 1
0
 
kipl20Author Commented:
thanks sage
0
 
evilrixSenior Software Engineer (Avast)Commented:
All the important C++ operators, with good descriptions, can be found here
http://www.cplusplus.com/doc/tutorial/operators/
0
 
mrjoltcolaCommented:
short hand for

f1 = f1 + 1


In general, any operators of that form (+=, -=, /=, *= and %= and so forth are shorthand for)

x <operator>= y

are shorthand for

x = x <operator> y
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.