do-while loops

Timon Gehr timon.gehr at gmx.ch
Wed Dec 28 07:54:54 PST 2011


On 12/28/2011 04:01 PM, Andrej Mitrovic wrote:
> A very small cheat:
> void main()
> {
>      if (int x = 0)
>      do {
>          x = 5;
>      } while (x != 5);
> }
>
> Only works for this simple case though. Put your post in d.general, I
> totally agree with it as well.

This won't work. The 'if' condition is always false.


More information about the Digitalmars-d-learn mailing list