362
unsafeCode
(lemmy.ml)
Post funny things about programming here! (Or just rant about your favourite programming language.)
That is why I use just
int main(){...}without arguments instead.Any
void main(){...}enjoyers?@stebo02 @Bogus5553 Neither of them require a return value, but
void mainisn't legal C++.void main(){...}is not in the standard, but works on both MSVC and GCC (with warnings). I think it works on both C/C++, but you really shouldn’t use it in production. Just useint main(void){...}, without any return value, which is permitted in the standard, and will return success iirc.It will also give an error if you try to add a return value anyways.
while (true) {...}int main(void) { . . . }for me!