Using [code] [/code] tags presents code in a more appealing way.
Code:
#define NodePtr struct Node*
typedef NodePtr List;
struct Node
{
ElementType data;
NodePtr next;
};
Regarding the #define, after preprocessing, the above code would be as follows.
Code:
typedef struct Node* List;
struct Node
{
ElementType data;
struct Node* next;
};
The typedef creates a synonym for the type specified. So with the above code, you could later declare something like the following.
Code:
{
struct Node node;
List list = &node;
}