开发者

What's the difference between these 2 declarations in c?

开发者 https://www.devze.com 2023-01-27 14:14 出处:网络
typedef int F1(int x开发者_Python百科); int F1(int x); Seems the same to me,either with typedef or not..typedef doesn\'t declare a variable; it declares a type.
typedef int F1(int x开发者_Python百科);

int F1(int x);

Seems the same to me,either with typedef or not..


typedef doesn't declare a variable; it declares a type.

After you say:

typedef int F1(int x);

later in your code you can have this:

F1 myfunction;

which is equivalent to:

int myfunction(int x);


typedef int F1(int x);

You define a function type F1 which is function taking a integer as argument and returning an integer

int F1(int x);

You define a function which is called F1

0

精彩评论

暂无评论...
验证码 换一张
取 消