My instructor said to me that the correct way of using a struct always should be done in a .c file instead in a header file. BUT he couldn't explain why a struct should be in a .c file.
Can anyone tell me more about this?
Printable View
My instructor said to me that the correct way of using a struct always should be done in a .c file instead in a header file. BUT he couldn't explain why a struct should be in a .c file.
Can anyone tell me more about this?
> Can anyone tell me more about this?
Perhaps your instructor is clueless - it seems to me that he is
Have a look in say time.h, that contains 'struct tm'
I have now talked to another intructor and he said that placing struct in .h or a .c file makes no difference.
There is a difference, especially if you ever plan on having your projects take up more than one file. Fire your instructors.
Quzah.
Was this really not about structs per se, but about declaration and definition?Quote:
Originally Posted by Mikro