I have a struct for a linked list in my C code. When the list is defined like this:
typedef struct LinkedList {
Ht_item* item;
LinkedList* next;
}LinkedList;
I get the Compilation Error: "error: unknown type name ‘LinkedList’"
alongside other related error messages
However, when i define my LinkedList this way:
typedef struct LinkedList LinkedList;
struct LinkedList {
Ht_item* item;
LinkedList* next;
};
I get no errors.
I do not understand why the Error happens in the first instance?