4 ms·
Beautiful code is simple maintainable code. In C this is a simple as: #include <stdio.h> int main(void) { puts("42"); return 0; }
by aninteger 8y ago
Beautiful code is simple maintainable code. In C this is a simple as:
#include <stdio.h>
int main(void)
{
puts("42");
return 0;
}
- sideshowb 8y agoBeautiful code denies its own existence so perfectly you forgot you wrote it
- askvictor 8y agoI 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.