I've been under the impression that main should always return an integer, and further that if the program operated correctly, it should return 0. I see a lot of programs which use return 1 at the end of main(). Isn't this telling the calling program that an error was detected when the called program finished? I realize that if the calling program doesn't check for errors, the 0 vs. 1 would probably be moot, but shouldn't 0 be used, just in case?
Along the same lines, there are a lot of tutorials/info sites that don't have any return in their main() sections, and many without main() declared as an integer. Are compilers just being built that don't care about these items, and if so, should programmers? Thanks.
0 · ·