Fun surprising things

bauss jj_1337 at live.dk
Wed Oct 31 14:00:14 UTC 2018


What's the output of this program? (Try to figure it out without 
running it.)

```
int c = 0;

int a()
{
     return c++;
}

int b()
{
     return c--;
}

void main()
{
     import std.conv : to;
     import std.stdio : writeln;

     writeln(to!string(a) ~ to!string(b));
}
```

If your answer is "10" then you're wrong.

You can get the result and answer here: 
https://run.dlang.io/is/idZurR


More information about the Digitalmars-d mailing list