Identifier list Vs Parameter type list in C

前端 未结 3 1460
花落未央
花落未央 2020-12-09 22:26
6.7.6.3 Function declarators (including prototypes)

This part of the standard deals with \'Identifier list\' and \'Parameter typ

3条回答
  •  [愿得一人]
    2020-12-09 23:01

    In C11 standard

    6.7.6.3 Function declarators (including prototypes)
    Constraints

    D( parameter-type-list )
    or
    D( identifier-listopt )  
    

    While declaring function you need not give identifiers list. BUt you should at least mention type list

    example:

    int sum(int,int); //declaration  
    
    int sum(int a,int b); //declaration
    

    both are declaration of same function .

    but second one you also mentioned identifiers that is optional.

提交回复
热议问题