+ 1
The concept of return is rooted in functions...
Every program you write in C++ must have a main function. Functions are defined to do a specific job and most of the times they should return the result of that job to the function that called it. The normal form of a function declaration is like:
return_type function_name(function_parameters)
{
the_body_of_your_function
}
The return type of functions are the same as variable types plus type "void" which means it doesn't return anything.
So now if you say:
int main()
The compiler assumes the return type is int and at the end wants some integer returned. But if you say
void main()
Then it will assume that nothing should be returned and you can skip the return 0; statement.
I know it might seem confusing for you but ask anything you still didn't get...



