0
What does the return 0; function mean
7 Answers
+ 4
What Suriya said. The 0 or 1 is its exit status that the OS uses to potentially display an error or not, depending upon if there was an error or if it closed successfully.
+ 3
In a method/Function it is possible to send a value to where it has come from:
int getNumber(){
return 0;
}
so if I call this like so:
print( getNumber() );
it will print out the value 0 because the Function is RETURNING 0
+ 3
@Dwayne The same thing it means in English.... it brings something back. It returns a value to whatever called the function.
0
In C and C++ programs the mainfunction is of type int and therefore it should return an integer value. ... On most operating systems returning 0 is a success status like saying "The program worked fine". In C++ it is optional to type " return 0; " at the end of the main function and the compiler includes it automatically.
0
what exactly does the term "return " mean in c++