Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C equivalent of C++ STL [duplicate]

Possible Duplicate:
Standard data structure library in C?

Does C have any data structure implementations similar to the C++ STL? Specifically associative containers, hash maps or any other structure with approximately constant time retrieval?

Thanks!

like image 721
CodeKingPlusPlus Avatar asked Jun 12 '12 20:06

CodeKingPlusPlus


People also ask

Is there something like STL in C?

C can't have an "exact equivalent" of STL because C doesn't have templates or classes.

What does STL stand for C?

The Standard Template Library (STL) is a software library originally designed by Alexander Stepanov for the C++ programming language that influenced many parts of the C++ Standard Library. It provides four components called algorithms, containers, functions, and iterators.

How do I copy one set to another in C++?

The '=' is an operator in C++ STL that copies (or moves) a set to another set and set::operator= is the corresponding operator function. Returns the copy of the allocator object associated with the set.

How do I copy a number in C++?

The copy() function in C++ is used to copy the values from an array/vector within a specified range to another array/vector. This function is available in the <algorithm.


1 Answers

C can't have an "exact equivalent" of STL because C doesn't have templates or classes.

You might be interested in the "Glib collections" library:

  • http://www.ibm.com/developerworks/linux/tutorials/l-glib/

  • Gnome Glib: http://developer.gnome.org/glib/stable/

  • GNU Gnulib: http://www.gnu.org/software/gnulib/

like image 192
paulsm4 Avatar answered Oct 02 '22 23:10

paulsm4