Computer Science Canada += and -= |
Author: | Raknarg [ Sun Mar 27, 2011 2:41 pm ] |
Post subject: | += and -= |
Just a quick question about the language... I've come across people using += and -= in their programs. I couldn't find any answers online or on the site, so could anyone tell me what it does? |
Author: | DemonWasp [ Sun Mar 27, 2011 2:48 pm ] |
Post subject: | RE:+= and -= |
Those are accumulate operators. They say "add everything on the right to the variable on the left". The statement x += 5 is equivalent to x = x + 5. |
Author: | Raknarg [ Sun Mar 27, 2011 3:09 pm ] |
Post subject: | RE:+= and -= |
Oh. How convienient. Oh, and one more: ~= |
Author: | Insectoid [ Sun Mar 27, 2011 3:23 pm ] |
Post subject: | RE:+= and -= |
in Turing that represents 'not equal to'. It's the same as writing 'not='. Most other languages use ! as the not operator. |
Author: | Raknarg [ Sun Mar 27, 2011 3:54 pm ] |
Post subject: | RE:+= and -= |
k thanks |