As far as Main
vs main
goes, the situation is simple: Microsoft decided on Main
to comply with its own naming conventions on capitalization.
The situation with static
vs. non-static
requires more background, though: C++ has something that C# does not have - namely, free-standing functions (i.e. functions that are not members of any class). When you apply static
keyword to a C++ function, its meaning changes based on whether the function is a member of a class or a free-standing one.
When you apply static
to a member function in C++, its meaning is the same as in C#, i.e. the function becomes a class function, not an instance function.
When you apply static
to a free-standing, non-member function, the meaning changes: C++ compiler makes the function invisible from outside the given translation unit. Among other things, this makes the function invisible to the part of C++ runtime library that processes the startup and passes control to your main
function.
Since C++ standard specifies that the entry point is through a non-member function, applying static
to main
would hide it from the C++ runtime, making it unusable as an entry point. See this Q&A for more info on what happens if you make your main
static.