Home  >  Article  >  Backend Development  >  What is the return value type of main function in c++

What is the return value type of main function in c++

王林
王林Original
2020-05-11 14:55:309382browse

What is the return value type of main function in c++

C standard stipulates: The return value type of the main function should be defined as int type.

C 98 defines the following two ways of defining the main function:

int main( ) 
int main( int argc, char *argv[] )

The return value type of the main function must be int. If there is no return statement at the end of the main function, C 98 stipulates that the compiler should automatically add return 0; to the generated object file.

The above is the detailed content of What is the return value type of main function in c++. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn