What are the major differences between ANSI C and K&R C?

后端 未结 11 1473
不知归路
不知归路 2020-11-29 04:10

The Wikipedia article on ANSI C says:

One of the aims of the ANSI C standardization process was to produce a superset of K&R C (the first publishe

11条回答
  •  情书的邮戳
    2020-11-29 04:33

    There are some minor differences, but I think later editions of K&R are for ANSI C, so there's no real difference anymore.
    "C Classic" for lack of a better terms had a slightly different way of defining functions, i.e.

    int f( p, q, r )  
    int p, float q, double r;  
    {  
        // Code goes here  
    }
    

    I believe the other difference was function prototypes. Prototypes didn't have to - in fact they couldn't - take a list of arguments or types. In ANSI C they do.

提交回复
热议问题