Hello. I am trying to compile my program but GCC accuses a few errors. Amongst them, there's two about "redeclaration" of typedefs/structs.
What am I doing wrong? How do I declare the signatures/headers on the .h and implementation on the .c?
Sorry, but it's not exactly the same. I am trying to separate the headers, but GCC tells me I am redeclaring the functions or that there's an "unknown type" if I write the structs like you've told me.
#include <stdbool.h>
#include <stdlib.h>
#include "queue.h"
void queue_push( queue_type* q, void* data )
{
...
}
Notice how I moved the standard headers into the .c file? Only include files strictly necessary for the header in the header. Stuff needed by the .c file goes in the .c file.