C
Cancerbero
Hi (first, excuse me for my bad english)
As I know, the semantics for typedef is:
typedef A B;
I think this makes B a synonym of A, where A is an existing data type. Is
that right?
Based on the previous definition of typedef, I can't understand the next:
typedef int (*TypeFunc) (int, int);
I think it's declaring a new type called TypeFunc. The objects of that
type are functions returning int and accepting two integer parameters.
But I can't understand the semantic of the last expresion. Based on the
first definition, the last should be:
typedef int (*) (int, int) TypeFunc;
/* first the existing datatype (pointer to function) and then the new
identifier datatype. */
Well, as you can see, I really can't understand the logic of the
semantics of typedef....
Thanks
As I know, the semantics for typedef is:
typedef A B;
I think this makes B a synonym of A, where A is an existing data type. Is
that right?
Based on the previous definition of typedef, I can't understand the next:
typedef int (*TypeFunc) (int, int);
I think it's declaring a new type called TypeFunc. The objects of that
type are functions returning int and accepting two integer parameters.
But I can't understand the semantic of the last expresion. Based on the
first definition, the last should be:
typedef int (*) (int, int) TypeFunc;
/* first the existing datatype (pointer to function) and then the new
identifier datatype. */
Well, as you can see, I really can't understand the logic of the
semantics of typedef....
Thanks