Class field inheritance

Adam Ruppe destructionator at gmail.com
Wed Jun 30 12:45:06 PDT 2010


Easy one: xa is null. This one used to bite me all the time too, since
I was used to C++ where XA xa; works on its own.

But in D, classes are always created by reference (think of them all
as pointers), so you have to new them before using them. Just add an
xa = new XA; to your constructor and it will work out.


More information about the Digitalmars-d mailing list