typedef struct class
{
...
}Class;
typedef struct node
{
Class data;
struct node *next;
}Node;
Node* newNode()
{
Node* temp = (Node*)malloc(sizeof(Node));
temp -> data = malloc(sizeof(Class));
temp -> next = NULL;
return temp;
}
The compiler says there is a problem with the line: temp -> data = malloc(sizeof(Class));, specifically "incompatible types in assignment".
What am I doing wrong?