Declare and Define Before Use? [rant]

Ali fakeemail at example.com
Wed Apr 4 20:01:55 UTC 2018


On Wednesday, 4 April 2018 at 19:51:27 UTC, kdevel wrote:
> On Wednesday, 4 April 2018 at 19:19:30 UTC, Ali wrote:
> BTW: You can't write
>
>    void main ()
>    {
>       x.writeln;
>       int x;
>    }
>    import std.stdio;
>

This is because x is not module scope
you can do this

    void main ()
    {
       x.writeln;

    }

    import std.stdio;
    int x;



More information about the Digitalmars-d-learn mailing list