typedef struct tnode { ... } Treenode;
Since typedef can't create a new type for us, is this part of the declaration of "struct tnode"? So in the above, is it creating a typedef "Treenode" AND declaring "struct tnode"?
return (Treeptr) malloc(sizeof(Treenode));
Here, since Treenode is a synonym for the entire "struct tnode" declaration, is it necessary to pass the whole declaration to sizeof or can one just do: sizeof(struct tnode) after declaring tnode elsewhere via struct tnode { ... };
typedef struct tnode *Treeptr;
Typedef is: typedef old-existing-type newtype; So here.. struct tnode * is the old type which must already exist (must be declared elsewhere) and Treeptr is the synonym for that.. but why can't we space the thing?? Like so: typedef struct tnode * Treeptr;
typedef int (*PFI)(char *, char *);
What is going on here? the old-type is int and (*PFI)(char , char) is a synonym for int?? If int (*PFI)(char *, char *) is the old-type, what's the new-type?? What does he mean by saying "In effect typedef is like #define, except that since it's interpreted by the compiler, it can cope with textual substitutions that are beyond the capabilities of the preprocessor"? In the mentioned example.. why can't the preprocessor do whatever is being done??