84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
如果加了就会出现 [Warning] parameter names (without types) in function declaration [enabled by default]
编译器把你那一行理解成函数声明(function declaration)了,所以提示你:没有参数的类型(without types)比如:int main(int argc, char *argv[]){
int main(argc, argv); return 0;
}则提示 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;
}则申明无歧义,没有警告。
调用函数无需写返回值类型,直接写函数名和参数
我也迷惑,回答问题有字书限制
因为调用本身就不加类型,加了类型就是声明了。
编译器把你那一行理解成函数声明(function declaration)了,所以提示你:没有参数的类型(without types)
比如:
int main(int argc, char *argv[])
{
}
则提示 line 3 [Warning] parameter names (without types) in function declaration [enabled by default]
int main(int argc, char *argv[])
{
}
则申明无歧义,没有警告。
调用函数无需写返回值类型,直接写函数名和参数
我也迷惑,回答问题有字书限制
因为调用本身就不加类型,加了类型就是声明了。