I\'m trying to create a simple singly linked list. Previously, I successfully did this with no errors, however now I encounter an error. I suspect that there is some kind of pro
typedef struct
{
} Product;
Declares a type alias called Product
for an unnamed struct - however you need a named struct for your forward declaration struct Product *next;
, otherwise the compiler cannot determine which definition it belongs to.
The simplest solution is to give the struct a name:
typedef struct Product
{
int value;
struct Product *next;
} Product;