How can D return 0 on success and non-zero on failure if main is void? -


in d, main function defined:

void main(/*perhaps args not remember*/) {  }   

i know sure function returns 0 on success , non-zero on failure , yet defined not returning anything. logic behind it?

function void return type not return value. there nothing illogical when consider call stack looks this:

os -> d runtime -> main 

the main function invoked d runtime system, recognized main function returns nothing - , in case return success os. in case main function defined return type int, d runtime return os value returned main function.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -