//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
The smatrix.h file contains the list.h and matrix.h files. If I include these header files in the smatrix.h file, I get
redefinition of 'lnode'. redefinition of '_llist' and redefinition of '_matrix' errors.
If I took these heder files from the smatrix.h file, then the error disappeared, but it complains about the type of matrix in the function parameter. I want to call the functions defined in the list.h and matrix.h files in the smatrix.c file. What should I do? Thanks in advance.
codereviewanskquestions
source share