B
ballpointpenthief
I am trying to build a generic type for data structures in order to be
able to build complex data structures based on other, simpler data
structures.
So, say we have linked lists, doubly linked lists, and hash tables as
some of our elements, we could build up combinations of these and
encapsulate them, and then combine these new types to form a new type
which could be extended further.
***One way might be to hold a structure-type pointer in the generic
data structure***, similar, in a way, to function pointers; but I don't
think that this is possible in C.
Is C simply the wrong language to do this kind of thing - I've started
working my way through the lectures at
swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/ so I'm sure
it has been done loads of times before - can it be done in C?
able to build complex data structures based on other, simpler data
structures.
So, say we have linked lists, doubly linked lists, and hash tables as
some of our elements, we could build up combinations of these and
encapsulate them, and then combine these new types to form a new type
which could be extended further.
***One way might be to hold a structure-type pointer in the generic
data structure***, similar, in a way, to function pointers; but I don't
think that this is possible in C.
Is C simply the wrong language to do this kind of thing - I've started
working my way through the lectures at
swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/ so I'm sure
it has been done loads of times before - can it be done in C?