How to convert a K&R function declaration to an ANSI function declaration automatically?

前端 未结 3 1807
既然无缘
既然无缘 2020-12-11 23:00
// K&R syntax
int foo(a, p) 
int a; 
char *p; 
{ 
    return 0; 
}

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

As you see, in

3条回答
  •  时光说笑
    2020-12-11 23:58

    You can use cproto or protoize (part of GCC) to generate function prototypes or convert old style (K&R) functions to ANSI format.

提交回复
热议问题