return the other functions of the void main()

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 9 04:09:42 PDT 2015


On Thursday, 9 April 2015 at 11:04:00 UTC, Dennis Ritchie wrote:
> Hi,
> Is it allowed in D similar designs?
>
> void main() {
> 	import std.stdio;
> 	return writeln("Hello, world!");
> }

Yes, because writeln returns nothing, but why would you do that? 
Just put the return on the next line, it's more readable. Or, in 
the example above, just omit it entirely as the return is 
implicit.


More information about the Digitalmars-d-learn mailing list