开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜