I recently met the following code snippet in this Apache Axis tutorial example.
int main()
{
int status = AXIS2_SUCCESS;
axutil_env_t *env = NULL;
axutil_allocator_t *allocator = NULL;
env = create_environment();
status = build_and_serialize_om(env);
(status == AXIS2_FAILURE)
{
printf(" build AXIOM failed");
}
axutil_env_free(env);
0;
}
What I do not understand is 0;at the end.
Is this a return statement without the return keyword?
I tried the following code snippet to test this in Visual Studio.
int main()
{
0;
}
Both programs worked without problems. But echo %ERRORLEVEL%at, the window command line returned 0 for both.
But below is a code snippet
int add()
{
0;
}
causes
Error 1 Error C4716: "Add": should return a value
I understand that the return value is 0implicitly added to main().
I have no problem, including the return keyword, but I'm porting the Axis2 / C library to a C ++ project. And there are many examples where I came across0;
undefined?