Search code examples
c++functionstaticc++17program-entry-point

In C++ programming, is the main() function static like in java or non-static like in C?


In C++ programming, is the main() function static like in java or non-static like in C?


Solution

  • From https://timsong-cpp.github.io/cppwp/n3337/basic.start.main#1

    A program shall contain a global function called main, which is the designated start of the program.

    It cannot be a static function.