Detect the bug in the following code

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 15 07:44:46 PDT 2015


import std.stdio;

struct Foo {
     bool registered = false;

     void register(int x) {
         writeln("Registering ", x);
         register = true;
     }
}

void main() {
     Foo foo;
     foo.register(10);
}


More information about the Digitalmars-d mailing list