What happens when you launch a D application ?

Rikki Cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 23 04:07:35 PDT 2015


On 23/05/2015 10:57 p.m., Suliman wrote:
>> Every D program is started as if it were a C program.
> Why is so necessary?
>
> What about C++ and other languages? Does they have more then one main?

Depends on the implementation. I believe Visual C++ does. But it is used 
like D's to allow it to initialize the runtime.
https://msdn.microsoft.com/en-us/library/bb918180.aspx

> Why it's more than one main is needed? Why D apps can't start with
> single main?

Oh but they can. But I guess you'll want things like the GC, module 
constructors ext oh and some globally initialized memory.


More information about the Digitalmars-d-learn mailing list