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.
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;
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law