I am teaching a guy who is something of a Java expert. Unfortunately, due to the mandatory-ness of the university curriculum, he is forced to downgrade himself to learning C. ( I use the word downgrade in a strictly technical sense, no offence meant to people who are fans of C ). The thing is, I am able to get him through the whole C syllabus except for pointers.
More importantly, we want to use pointers inside structs, which are actually declared in a header file. I am teaching him to build sharable c libraries/header files. If you need more details, let me know in the comments, and I can share the code I am using in a repo and so on.
Update 1 - I am also looking at this, but its not very clear to me. I haven't used C in a decade, so all this is a little blurry for me.
Update 2 - getting even more specific, what is really happening in these two lines, that I am putting in the header file. I am defining the samplestruct in the corresponding .c file.
typedef struct samplestructrec *samplestruct; typedef struct samplestructrec samplestruct;