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

前端 未结 3 1824
既然无缘
既然无缘 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-12 00:00

    1) if you want to create standard C prototypes for a .h file use mkproto.c

    mkproto thisoldfile.c > thisoldfile.h

    You then could also paste over the old K&R code in the C file definition if desired.

提交回复
热议问题