Abstract Data Types in C

The Beach Bum jfh at rpp386.Dallas.TX.US
Sun Oct 16 14:43:47 AEST 1988


In article <116 at capshaw.UUCP> sdc at capshaw.UUCP (Dan Capshaw) writes:
>Is anyone out there using ADTs in C?  If so, am I missing something
>here?  And finally, if ADTs are not as I have described them, what
>are they, and how can they be used in C (if in fact they should be used
>in C)?

Yes, on very large and hairy projects they are a must.

What you and your friend are probably missing is the need to discipline
yourselves to do the hard work and keep the data type abstract.

An example of how this might happen is if you have a routine CreateObject(),
which creates and initializes the object, but then you use free() to
dispose of the item rather than having yet another routine, DestroyObject()
which itself may only be a call to free().

You have to not know the details of the implementation, and what details
you are permitted to know must be very well documented.  This is why
documentation is so very important.  It defines what you are permitted
to use reliably.
-- 
John F. Haugh II                        +----Make believe quote of the week----
VoiceNet: (214) 250-3311   Data: -6272  | Nancy Reagan on Richard Stallman:
InterNet: jfh at rpp386.Dallas.TX.US       |          "Just say `Gno'"
UucpNet : <backbone>!killer!rpp386!jfh  +--------------------------------------



More information about the Comp.lang.c mailing list