I have a forward declaration of a struct in .h file and full declaration of the same struct in .c file. I want to access it's members, but I get
member access into incomplete type struct channel Here is my code:
verbs.h
struct channel;
verbs.c
struct channel{
int index=10;
};
main.cpp
#include "verbs.h"
...
struct channel* ch;
...
ch->index;
verbs.h and verbs.c are legacy code, so I can't change them. Is there a way I can solve this problem?
Create
verbs2.hwith the copied content fromverbs.c.verbs2.h
And just
#include "verbs2.h".