In C, what is the difference between `&function` and `function` when passed as arguments?

后端 未结 4 1692
醉酒成梦
醉酒成梦 2020-12-05 07:41

For example:

#include 

typedef void (* proto_1)();
typedef void proto_2();

void my_function(int j){
    printf(\"hello from function. I got          


        
4条回答
  •  醉梦人生
    2020-12-05 08:16

    There is no difference. For evidence see the C99 specification (section 6.7.5.3.8).

    "A declaration of a parameter as ‘‘function returning type’’ shall be adjusted to ‘‘pointer to function returning type’’, as in 6.3.2.1."

提交回复
热议问题