Hi there,
I am trying to write a queue ADT using a linked list in C and have hit a snag initialising my queue...
typedef struct qNode{
int element;
struct qNode *next;
} qNode;
typedef struct Queue{
struct qNode *front;
int len;
} Queue;
Queue create_queue()
{
Queue q = (Queue)malloc(sizeof(Queue));
q->head = NULL;
q->len = 0;
return q;
}
I get an error "conversion to non scalar type requested", is this something to do with my struct? or does a structure need certain code to allocate memory to it?
Thanks,
Logi.