Manfred_Nowak Wrote:

> docs:
> | Expressions that have no effect, like (x + x), are illegal in
> | expression statements. 
> 
> But what sorts of effects are meant with this?

(x + x) performs a calculation and throws out the result.

x = 42; x = 42;

This is performing an assignment of the same value.

Note that the difference is that the first is context free. x = 42 is doing 
something even though it would not change behavior of the running program. The 
first one is just having the CPU run some computation and does not affect the 
state of the program.

Reply via email to