As per ISO_14882_2014
3.6 Start and termination [basic.start]
3.6.1 Main function [basic.start.main]
2 An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a declared return type of type int, but otherwise its type is implementation-defined.
but otherwise its type is implementation-defined. That means compiler may have its own return type for main(). Can you point me to the location where GNU G++ compiler says about main()'s return type.
mainalways has to return anintbecause of that sentence. It's the parameters that are implementation defined. - NathanOliverreturn type of type int,is misleading. - Ujjwal