Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
FAQ about my personal style and syntax.
I use const whenever possible [3-8], so I nearly always use const return types.
I do write:
int main() |
I do not write:
const int main() //Not my style and non-standard |
This is because the standard states that main has one of the following syntaxes [1] :
int main() { /* Your code */ } |
and
int main(int argc, char* argv[]) { /* Your code */ } |
I choose to stick with the standard.
When main reaches its closing bracket, I never write explicity to let main return a zero.
I do write:
int main() |
I do not write:
int main() |
This is because the standard states that the closing bracket of main() must have the same effect of returning zero [2]. Therefore, return zero can be omitted. And I do so.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.