Structure Pointers & Encapsulation & 'ting

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?
 
H

Herbert Rosenau

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.
Read your C book what it has to say about the keywords struct and
union.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top