I am doing an assignment that asked me to implement a priority queue. It has to pass 19 assertions. I can pass 18/19 assertions but it gets stuck on this one.
assert(head->data == "first node");
This doesn't make sense to me because why is it using == to compare two strings rather than strcmp
? How am I supposed to pass this assertion? I'm not allowed to change the code with the assertions. Is this a mistake by the prof or is there something I'm missing.
The struct used to access the data is below.
typedef struct node {
int priority;
char * data;
struct node * next;
} Node_t, * Node_ptr_t;