Writing Program Without main Function

Samir samir at aol.com
Fri Dec 7 21:02:59 UTC 2018


Is it possible to write and execute a D program without a main 
function?

Most of my programs will start with some `import` statements, 
followed by any functions and then ending with the `main` 
function (e.g. `void main() {`).

As I am just a beginner to programming and still new to D, I have 
been browsing some repositories that people have posted here to 
learn more about the language and how more experienced 
programmers write their code.  In many of these examples, they 
start with the `module` statement followed by their `import` 
statements and then will have sections defining various classes, 
structs, unit tests and other bits but I never see a `main` 
function.

How do you compile and execute these programs?

Thanks
Samir


More information about the Digitalmars-d-learn mailing list