voidmain(){...} 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 use intmain(void){...} , without any return value, which is permitted in the standard, and will return success iirc.
@stebo02 @Bogus5553 Neither of them require a return value, but
void main
isn’t legal C++.yeah I thought so, does it work in 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.