Dne 6.1.2015 v 22:25 Suliman via Digitalmars-d-learn napsal(a):
> On Tuesday, 6 January 2015 at 21:19:38 UTC, bearophile wrote:
>> Suliman:
>>
>>>     void foo()
>>>     {
>>>     writeln("test");
>>>     writeln(mystring);
>>>     }
>>>     foo();   <<<<<
>>> }
>>
>> I guess you have to remove that line.
>>
>> Bye,
>> bearophile
> 
> Why? I can't call function in instance of class?

What would that even mean? When would the function ran? If you want to
call that function during instantiation, put it into constructor. If you
want to call it sometime later, than you have to call it from somewhere
else. But having a function call inside a class does not compute...

Martin

Attachment: smime.p7s
Description: Elektronicky podpis S/MIME

Reply via email to