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

王林
Release: 2020-05-11 14:55:30
Original
9433 people have browsed it

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[] )
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template