连同其他一些,以下是 main()
的有效原型(prototype):
int main(void)
int main(int, char**)
在 C 中,我们不能重载函数,因此永远不可能同时拥有两者。但在 C++ 中,情况并非如此。如果我要在编译的 C++ 可执行文件中同时使用两者,那么使用哪一个?它取决于命令行吗?标准怎么说?
最佳答案
C++11 §3.6.1/2:
” This function shall not be overloaded.
关于c++ - 如果我指定多个,则使用哪个 `main`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27509366/