//list.h file
typedef struct _lnode{
struct _lnode *next;
size_t row;
size_t column;
short data;
}lnode;
typedef struct _llist{
struct _lnode *head;
size_t size;
}llist;
//matrix.h file
typedef struct _matrix{
size_t width;
size_t height;
size_t k;
int **data;
}matrix;
//smatrix.h file
#include "list.h"
#include "matrix.h"
typedef struct _smatrix{
size_t width;
size_t height;
size_t k;
llist data;
}smatrix;
smatrix* make_smatrix(matrix *m);
smatrix.h file includes list.h file and matrix.h files. If I include those header files in smatrix.h file then I get
redefinition of 'lnode'. redefinition of '_llist' and redefinition of '_matrix' errors.
If I took those heder files our from smatrix.h file then the error went away but it complains about matrix type in the function parameter. I want to call functions defined in list.h and matrix.h files in smatrix.c file.. What do I do? Thanks in advance..