Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any standardized and commonly-used library for C (C99 or whatever), as STL is for C++? [duplicate]

Tags:

c++

c

stl

Possible Duplicate:
Container Class / Library for C

I expect I'd be forced to use vectors, lists and sets for my C program. Should I invent those entities from scratch, or there is some kind of standard library for C as STL is for C++ ?

like image 538
mbaitoff Avatar asked Oct 13 '22 18:10

mbaitoff


1 Answers

C doesn't have templates, so it might be difficult to implement those C++ collections in a generic way. I'm not aware of any libraries that implement those features in C.

If I were faced with such a situation, my first thought would be to isolate the parts of my program that would benefit from C++ features, write them in C++, then provide an extern "C" interface to those modules so they could be called from the pure C parts of the program. Is that an option for you?

like image 137
Jim Lewis Avatar answered Nov 15 '22 07:11

Jim Lewis