Void main () & amp; int main (), voidmain

Source: Internet
Author: User

Void main () & int main (), voidmain

Void main () does not exist, only int main ()

The void main function does not return values. The default value of main is int type, that is, int main (). An integer is returned. Note that the new standard does not allow the use of the default return value, that is, the int value cannot be saved, and the corresponding main function no longer supports the void type return value. Therefore, in order to make the program have good portability, it is strongly recommended to use:
Int main ()
{
Return0;/* the return value of the new standard main function can be omitted */
}
Function of return value:
The Return Value of the main function is used to indicate the exit status of the program. If 0 is returned, the program Exits normally. The meaning of other numbers returned is determined by the system. Generally, if the return value is non-zero, the program exits unexpectedly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.