My compiler doesn't give any warnings when I compile this. Is there something wrong with it, or is it just a feature of main?Code:int main() { }
My compiler doesn't give any warnings when I compile this. Is there something wrong with it, or is it just a feature of main?Code:int main() { }
You mean, there is no return?
Main is a special function and the language standard - I think - requires that main return 0 if not specified explicitly.
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
In short, no.
main() is the first function the operating system calls to envoke the program and that is obviously the starting point of the C/C++ program. If you did not include main then you would get a linker error asking you where it was.
Double Helix STL