In C++ that's hardly needed anymore, i.e. a main() function has to exist to keep
the linker happy but the entire shebang can be started from a global class object
that does it all, starting from its initialization code. The main method won't even
be called.
I am well aware of that, in fact came up with the minor brain teaser what does this code do in C and C++
-
struct SomeStruct StructInstance;
-
-
int main(int argc, char **argp)
-
{
-
return 0;
-
}
-
To which the answer is in C it does nothing and in C++ it could do anything you don't know without seeing more code. This is not the only case of this, references provide another opportunity for this sort of confusion with similar question of does this function call change the calling functions data?
Additionally in many embedded platforms (especially in C) a main is not strictly speaking required, the argc and argp arguments are often not used for anything and you often have direct access to the cstartup code written in assembler often ending in
[indent]bra $main[/code]
or something similar. There is absolutely nothing preventing you from altering the cstartup code and changing "main" to some other name. You do still have to have and entry point function though.