【发布时间】:2012-12-02 08:20:35
【问题描述】:
可能重复:
Why is the type of the main function in C and c++ left to the user to define?
什么是 void ?有人提供一些例子,正确使用 void 吗?而我们写void main (void)或main()有什么区别?
【问题讨论】:
-
我建议阅读en.wikipedia.org/wiki/Void_type 它包含有用的信息,例如这句话:“void 类型也可能作为函数原型的唯一参数出现表示该函数不带参数。”
-
你可以在这里找到你的答案:stackoverflow.com/q/3711048/1284631(这个问题是重复的)
-
我根本不认为这是重复的。