如果加了就会出现
[Warning] parameter names (without types) in function declaration [enabled by default]
迷茫2017-04-17 14:48:50
The compiler interprets your line as a function declaration, so it prompts you: type without parameters (without types)
For example:
int main(int argc, char *argv[] )
{
int main(argc, argv);
return 0;
}
will prompt line 3 [Warning] parameter names (without types) in function declaration [enabled by default]
int main(int argc, char *argv[])
{
int main(int argc, char *argv[]);
return 0;
}
declares no ambiguity and no warning.
高洛峰2017-04-17 14:48:50
There is no need to write the return value type when calling a function, just write the function name and parameters directly
巴扎黑2017-04-17 14:48:50
Because the call itself does not add a type, adding a type is a declaration.