If you need to use a structure in a .c file, then it needs a full definition of the structure at compilation. This is often done using #, including the header file with the definition.
If you do not need to use a structure definition, you can put it in a .c file, but it will only be available for functions inside this file.
It seems that you are trying to have an interface to your structure and only define it in the .c file to stop other parts of your code by accessing the structure. You can do this, but only with a pointer. For example:
typedef struct MyString* MyString;
And in the .c file you can define it. Instead, you can define functions with a Mypedring typedef.
Cthutu Nov 09 2018-10-11T00: 06
source share