this is my .h file:
struct _MyString;
typedef struct _MyString MyString;
i would like to declare its members in the .c file.
i tried:
typedef struct MyString{
char * _str;// pointer to the matrix
unsigned long _strLength;
}MyString;
but it doesn’t work.
how do i declare the struct’s memebers in the .c file?
thank you
You need only 1 typedef. Keep the one you already have in the .h file and delete all others.
Now, the struct name is
struct _MyString. That is what you should define in the .c file, notstruct MyString: notice the absence of the ‘_’.So
.h file
.c file