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
精彩评论