Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why does indentier main appear when typing void main? main is not the same as voidmain
Why does indentier main appear when typing void main? main is not the same as voidmain

Standard C++ requires main to have an int return value, which indicates the normal end of the program. int main() corresponds to return 1; (return an integer value)

But in C, void main( ) that is, main() has no return value

Although the C++ standard does not allow main to be void, some compilers such as VC6 allow main to be void.

The header file declares as #include(The .h header file in C++ supports C and is non-templated)

If you are learning C++, it is better to write int main()