// K&R syntax
int foo(a, p)
int a;
char *p;
{
return 0;
}
// ANSI syntax
int foo(int a, char *p)
{
return 0;
}
如您所见,在 K&R 风格中,变量的类型是在新行而不是大括号中声明的。如何将 K&R 函数声明自动转换为 ANSI 函数声明?有谁知道 Linux 中有这么好用的工具吗?
最佳答案
您可以使用 cproto或原型(prototype)化(GCC 的一部分)以生成函数原型(prototype)或将旧式 (K&R) 函数转换为 ANSI 格式。
关于c - 如何将 K&R 函数声明自动转换为 ANSI 函数声明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8068038/