empty at needmail.com
Tue Mar 4 06:03:15 PST 2008
Why isn't it initialized?
I mean, when are these null referenced class pointers useful?
>>> may be this?
>>> Class className;
>>> className=new Class();
>> Yes it is :)
>> What then does Class className do exactly? Or, why do I need to use
> The same reason:
> Class class;
> doesn't work. Because all class variables are references which point to
> nothing until you use 'new'.
> A Class is an array of references to class instances which is filled
> with nulls by default. You have to actually initialize the array by
> creating instances of the class.
> Class arr;
> foreach(ref c; arr)
> c = new C;
More information about the Digitalmars-d-learn