On Wednesday, August 28, 2024 3:44:59 PM MDT Johann Lermer via Digitalmars-d-
learn wrote:
> 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
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.
On Friday, 23 August 2024 at 09:49:27 UTC, Nick Treleaven wrote:
On Friday, 23 August 2024 at 09:42:38 UTC, Nick Treleaven wrote:
C++: undefined, could be `6 + 6` if the increment is done
first. g++ gives me a warning with `-Wall`:
You asked about C, for some reason I used C++.
I think the `
On Friday, 23 August 2024 at 09:42:38 UTC, Nick Treleaven wrote:
C++: undefined, could be `6 + 6` if the increment is done
first. g++ gives me a warning with `-Wall`:
You asked about C, for some reason I used C++. But it's the same
in C, and the error happens with `gcc -Wall`.
On Friday, 23 August 2024 at 08:58:16 UTC, Me'vâ wrote:
```
import std.stdio:writeln;
void main() {
int i = 5;
writeln("Result: ", i + ++i);
}
```
When I run this, it surprisingly outputs 11. I tried something
similar in C before and it gave me 12. I’m curious, why is
there a differen