main() return value

I have seen many programs use return false for main() when an error is occured. Is this correct? It seems to me that return false = return 0 = return EXIT_SUCCESS, so that in fact, if you encounter an error, you would need to return true in order to return a failure code?
The return value of main() is irrelevant for most applications.
Nevertheless, your assessment is correct. It is silly to return false because that makes no sense.
YES, bool is cast to int and int is cast to bool..

1
2
3
4
5
6
7
int foo() {
    return true;
}

bool boo() {
    return 1;
}


EXIT_SUCCESS is also equal to 0
http://cplusplus.com/reference/clibrary/cstdlib/EXIT_SUCCESS/
Topic archived. No new replies allowed.