3 ms·
I was curious why you would return a value and not just make the main function return void (in the interests of simplicity and maintainability, and assuming you
by askvictor 8y ago
I was curious why you would return a value and not just make the main function return void (in the interests of simplicity and maintainability, and assuming you're using C not C++). So I wrote my own such program, and discovered that void main(void) returns 3 to the OS. Any ideas why?
- innocenat 8y agoBecause returning void means that, on most platform, return whatever is left in %eax at the time of function termination.