Your professor remembers ancient versions of C in which =+ , =- , =* , etc. actually meant the same thing as += , -= , *= , etc. (We're speaking higher than the version commonly referred to here as “K & R.” UNIX version 6, if memory serves.)
In current versions of C, they do not mean the same thing; versions with an equal sign will first be sorted out, as if there was a space between equals and what comes after. This means that for =- and =+ there is a valid program (although not a program that does what you expect), because - and + can be used as unary operators.
=* or =/ can be used to resolve the argument. a *= 3 multiplies a by three, and a /= 3 divides it into three, but a =* 3 is a semantic error (since unary * can only be applied to pointers), and a =/ 3 is a syntax error (since / does not can be used as a unary operator).
zwol
source share