I have this problem with circular dependency in C, I looked around the other questions about this topic but really couldn\'t find the answer.
I hav
This kind of dependency is broken using a forward declaration. Instead of including a file with the full definition of the struct, there are two alternatives:
1.
typedef struct
{
char* name;
float x, y;
struct _edgelist* edges; /* add "struct" here (elaborated type specifier) */
} vertex;
2.
struct __edgelist; /* better form: forward declaration */
typedef struct
{
char* name;
float x, y;
struct _edgelist* edges; /* still need to add "struct" here */
} vertex;