Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Why do some programs in C language have a return value of 0 at the end and some don't? When should I have it and when should I not have it?
Why do some programs in C language have a return value of 0 at the end and some don't? When should I have it and when should I not have it?
When a function needs to return a value, it must have a return statement.

For example, int main () needs to return a value of type int, so return statement 0 usually indicates normal operation.

If void function (); Because void means that there is no need to return a value, there is no need for a return statement, but it can also be expressed by return void.