STL-like lib for C

Hello Folks,

I need your help if there is an equivalent lib for C (not C++) to provide abstract data type functionality under C.

I have found LIBCX but after a short investigation I found that it uses pointers to data (of course for generalization) but the point here is I need to warry about type safety myself. So, is there a better approach?

regards,

AY

Comments

  • There is no such thing as type safety in C, which is one of the reasons it is more powerful than most OO languages... You could create it yourself with structs and such though.

    Anyway, there ought to be tons of code for various ADTs to be found on the net, and probably on Programmer's Heaven too.
  • : Hello Folks,
    :
    : I need your help if there is an equivalent lib for C (not C++) to
    : provide abstract data type functionality under C.
    :
    : I have found LIBCX but after a short investigation I found that it
    : uses pointers to data (of course for generalization) but the point
    : here is I need to warry about type safety myself. So, is there a
    : better approach?
    :
    : regards,
    :
    : AY
    :

    IMO, you should consider learning C++. Even if most of your code is still in C, you could use C++ to tie it all together -- and use C++'s library. It's what I do, and it works well.

    C lacks type safety, for the most part. That's just how the language is. If that's what you like, go for it. But if you're looking for type safety, abstracted data types, etc., C is probably not the right language.

    Check out "Thinking in C++" (http://mindview.net/Books/TICPP/ThinkingInCPP2e.html). Bruce Eckel (at least in my opinion) explains very neatly the differences between C and C++, although admittedly with a bias toward C++.

    Sincerely,
    Jakykong (Jack Mudge)
    jack_mudge@hotmail.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories