Understanding the Behavior of i + ++i in D Language

Johann Lermer johann.lermer at elvin.eu
Wed Aug 28 21:44:59 UTC 2024


On Friday, 23 August 2024 at 08:58:16 UTC, Me'vâ wrote:
>     writeln("Result: ", i + ++i);

I would definitely expect 11 as result (but I still have K&R on 
my book shelf, maybe I'm a bit biased). So, when you get 12 with 
C, I would consider that an error.


More information about the Digitalmars-d-learn mailing list