*= question

25 *= 2

what does the *= mean? I can't find the answer anywhere!! thanks...
Your example is invalid. Left side of the equal sign must be a variable.

1
2
int someVar = 2;
someVar *= 25; //This is the same as someVar = someVar * 25; 


Same thing goes for +=, -=, etc.
It's called "compound assignment" and you can find it in the beginning of pretty much any C tutorial. For instance the one right here!:

http://cplusplus.com/doc/tutorial/operators/
In short, its a simpler way of typing:
1
2
int var = 25;
var = var * 2;
Topic archived. No new replies allowed.