Hi
I have come accross this in my programming book...
This is probably very easy but i have no idea what it is.Code:+=
Thanks in advance.
Printable View
Hi
I have come accross this in my programming book...
This is probably very easy but i have no idea what it is.Code:+=
Thanks in advance.
It takes the value you have and adds something to it.
Its the same as doing:
int a = 10;
a= a+ 4;
Thanks
There's a good chance that the index of your book lists these symbols before "A".
Basically, C++ has quite a few "composite assignment" operators of the form op=, where op is any of [+, -, *, /, %, &, |, ~, <<, >>] and perhaps more that I forgot. They all are defined such that
expr1 op= expr2
is equivalent to
expr1 = expr1 op expr2
except that expr1 is evaluated only once.