for loop

RenatoL rexlen at gmail.com
Sun Jan 22 05:23:36 PST 2012


This works:

import std.stdio;
void main()
{
    int x = 0;
    int y = 0;
    for(; ((x < 5) && (y < 5)); x++, y ++)
    {
        writeln("x + y = ", x + y);
    }
}

The question is easy: is it possible to insert x and y internally
in the for header? that is something like C#

for (int x = 0, int y = 0; .....)

this doesn't work in D.


More information about the Digitalmars-d-learn mailing list