C - Struct in multiple files without header file
c, data-structures, struct
Solution
Place the contents of what would be in the header file in each source file.
It is extremely difficult to discern why anyone would impose such a requirement. It is rather like being required to build a wood frame house without any tools made of metal. Any idea what it might be trying to teach?
Problem
I'm doing a college project in `C` which is quite strict in its requirements in that I'm not allowed to include any additional files or modify any header files. I'm currently trying to implement a linked list to store some records and I need it to span over two `.c` files. Currently to use global variables I've been declaring variables in `file1.c` and then in `file2.c` using `extern`. But how do I go about doing this for structures as I've always just added it to the `.h` file? Cheers