How should I organize implementations and declarations in C?
|Added at||2016-12-10 16:12|
I am trying writing my first little project and I don't know the best way to organize all of my head files and source files.
Is every head file has its corresponding source file (one on one), or there are couple source files that implemented one specific head file(several-for-one). What kind of function should be writing into a head files?
Should I jam all data structures(linked list, queue, stack, graph...) into a head file, however, it make the code looks unstraightforward. Or in another way, place them into different files according to its function(e.g if a queue is used to collect input strings, write it info
I do not know how to write data structure in c in a brief and effective way.
As we all know, C doesn't support generic type, so it seems inevitable to write a several of same ADT that contain different ItemType.
For instance, I want to write a simple calculator, then I need to parse the expression, and It is necessary to use a double stack to collect numbers and a char* stack to collect operation symbols. I don't have a idea avoid writing same