I'm not sure what the standards are nowadays, but in traditional ANSI C, using empty parentheses indicates that the function can take any number of arguments. Declaring a void
parameter on the other hand indicates that the function only takes zero arguments. In this case (and many others), it really doesn't matter too much.
If you want to be strict though, it's probably best to define the void
parameter. Of course, the main
function can also be defined as int main(int argc, const char* argv[])
- which is perfectly valid, but often unnecessary if you don't care about arguments.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…