Hi
To make a struct's members "private" to the outside I know that I can do this.
In the .h file
typedef struct Obj Obj;
In the .c file you then
struct Obj {
int a;
int b;
}
This will keep the knowledge of the existense of a
and b
from beeing known. But all the "member" functions in the .c file will now about them and can opperate on then.
But what I wonder about now is that if you can make PART of the struct "private". Say that I want to keep those a
and b
variables "private" but then I want to have some function pointers that I want to remain public. Is this possible?
I know that if I try to declare these in the struct in the .h file I would get a duplicate declaration error on the struct.