I am new to C programming.
So this is in my header file
typedef struct Rec *node;
This is in my c file
#include <stdio.h>
#include <stdlib.h>
#include "header.h"
typedef struct Rec *List;
typedef struct Listing{
node *items;
int numelems;
struct List *next;
}Listing;
int sum(List L)
{
if(L->items == NULL)
{
return NULL;
}
return (L->head + sum(L->tail));
}
int main(void)
{
return 1;
}
I am getting this error where it says
dereferencing pointer to incomplete type at if(L->items == NULL)
.
I know that it is in my struct but I do not know how to fix it. I tried trial and error however I would like to understand what and where my error is.
PS: this program is just for myself learning.