This question already has answers here:
Closed 3 years ago.
Alternative (K&R) C syntax for function declaration versus prototypes
(5个答案)
K&R函数声明和ANSI函数声明有什么区别?

最佳答案

K&R语法已经过时,除非必须维护非常旧的代码,否则可以跳过它。

// K&R syntax
int foo(a, p)
    int a;
    char *p;
{
    return 0;
}

// ANSI syntax
int foo(int a, char *p)
{
    return 0;
}

关于c - 函数声明:K&R与ANSI ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18323438/

10-15 16:35