You cannot use pEDGE in a structure definition. You are doing something like:
typedef struct edge { pEDGE_ITEM *edge_item; struct edge *next;
You should also notice that edge_item
is a double pointer. You also mentioned this in your question. Therefore, if you use pEDGE_ITEM
and you just want to have a regular pointer, you should not write pEDGE_ITEM *edge_item
, but just pEDGE_ITEM edge_item
.
For clarification, all of the following declarations are equivalent:
struct edgeitem *edge_item; EDGE_ITEM *edge_item; pEDGE_ITEM edge_item;
But
pEDGE_ITEM *edge_item;
equivalently
struct edgeitem **edge_item; EDGE_ITEM **edge_item;
O *EDGE next
, this is the wrong syntax. The correct syntax will be EDGE* next
or pEDGE next
. So, once the struct edge
defined, you can simply use either of these two, but when defining the structure you have to do as I will show at the beginning of my answer.
Yes, the following two definitions are equivalent:
typedef struct edge_list { EDGE *head; } EDGE_LIST; typedef struct edge_list { pEDGE head; } EDGE_LIST;
source share