小编ioc*_*ode的帖子

为什么不能将隐式类型函数参数与显式类型函数参数一起使用?

如果我要编译以下代码:

// x is implicitly typed as int
void foo(x, char y) {
    return;
}
Run Code Online (Sandbox Code Playgroud)

会发生语法错误 ( expected identifier),但我不确定为什么此语法无效。

然而:

void foo(int x, char y) {
    return;
}
Run Code Online (Sandbox Code Playgroud)

编译成功。

那么为什么这个语法无效呢?我不是 C 方面的专家,所以我不确定这是否是一个愚蠢的问题。

c syntax-error

3
推荐指数
1
解决办法
92
查看次数

标签 统计

c ×1

syntax-error ×1