This works too:
#define NodePtr struct *Node
Quzah.
Printable View
This works too:
#define NodePtr struct *Node
Quzah.
Nutshell wrote:
typedef struct stackNode StackNode;
typedef StackNode *StackNodePtr;
----------------------------------------------------
First typedef: StackNode is synonymic to struct stackNode.
Second typedef, it can be rewrited as "typedef struct stackNode *StackNodePtr", true or false?
If this is true, then *StackNodePtr is synonymic to StackNode which is also struct stackNode. Then, how on earth a pointer can be a synonym to a structure?? I'm really confuse. Please help!:confused:
Second typedef, it can be rewrited as "typedef struct stackNode *StackNodePtr", true or false?
If this is true, then *StackNodePtr is synonymic to StackNode which is also struct stackNode. Then, how on earth a pointer can be a synonym to a structure?? I'm really confuse. Please help!
*StackNodePtr is not synonymous to StackNode. "typedef struct stackNode *StackNodePtr" declares a POINTER to the stackNode struct. StackNode, on the other hand, is declared as a synonym for struct stackNode, but NOT a pointer to that struct. So that's the difference.