How would I go about linking 2 header files that depend on each other with their c files?
For instance I have a file stack.h
that depends on a struct declared in linkedlist.h
, and the file "stack.c" calls on functions from linkedlist.c
which depend on both header files. main.c
depends on both header files
linkedlist.h
#include <stdio.h>
#include <stdlib.h>
#include "stack.h"
struct listNode
{
int nodeValue;
struct listNode * next;
};
typedef struct listNode listNode;
stack.h
#include "linkedList.h"
typedef struct stack {
listNode *list;
}stack;