std::vector alternative for C [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I wonder if there is an alternative for the std::vector in C? I found this implementation but it seems to contain some issues with memory reallocation.

You can give glib and its arrays (GArray) a try.
glib is actively maintained, cross platform, open source (LGPLv2+), and it doesn't stop on arrays/vectors. You also have hash tables, linked lists, queues and many other data structures.

While reading C Array vs. C++ Vector, I found an interesting implementation of a simple vector container in C, which also includes push/pop operations. It's worth reading it!

If you focus is on mathematics you can work with GSL, there have a more bare bones math centric concept.

Related

Generic implementation for Java like List in C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have one requirement in one of my projects, where I have to deal with lots of data. Typically huge, dynamic arrays in C.
I searched but I have not been able to find what I need.
I am looking for a usable library, which encapsulates the details of list implementation in C, and provides various functions for List manipulation.
I am aware that we can create such implementation in C, using pointers.
I have followed below links:
C generic linked-list
Generic list manipulation function in C?
Thanks in advance.
May be this small library is what you need.
It is a generic list implementation in C. glist

What are the common libraries for C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
C++ has STL and Boost and C# has the .net Framework library. Similarly, what are the most common libraries useful to a C programmer? (Other than the C standard library.)
I am looking for most of the capabilities available in the STL: containers (vectors, linked lists, trees, hash table), algorithms (sorting, searching), file IO and strings.
Ideally, the library should be open-source, work on Windows (cross-platform is fine) and is being used actively.
If you want general-purpose data-structures like STL has, glib is probably the answer to your question. But a better question might be why are you writing your program in C? C's potential to shine comes when you don't use overly-general code to perform tasks that could be better performed in ways specific to your particular task at hand. glib just gives you "C++ with ugly syntax" (and less ability for the compiler to optimize).
The closest I know if is glib from GTK, see http://library.gnome.org/devel/glib/2.26/
Yes. GLib is the closest thing to STL in C. If you find it quite complex to use, try Vala. It is much easier. http://live.gnome.org/Vala

C libraries for mathematical matrix operations [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I know there are some optimized algorithms around for all kind of matrix decompositions (QR decomposition, SVD,...), multiplications and the likes. Yet, I couldn't find a good overview. For C++, there is quite some useful information in this question, but I'm looking for those things in C.
You did not mention whether you wanted an open-source or a commercial software, so here is a list containing both:
GNU Scientific Library (GSL)
Basic Linear Algebra Subprograms (BLAS)
Meschach
Numerical Algorithms Group (NAG)
There was also this previous question on the subject.
You might want to take a look at BLAS and LAPACK. These are written in Fortran, but are callable from C, and are pretty much the standard libraries of this type.
Most serious linear algebra packages that I know of (MATLAB, Octave, NumPy) are built using these.
Perhaps GNU Scientific Library (GSL) would be of interest.
http://www.gnu.org/software/gsl/
Documentation topics: http://www.gnu.org/software/gsl/manual/html_node/

What would be a good open source lightweight c library with basic utility functionality to use in an embedded system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm thinking of something like glib, but possibly a slim version with a minimal foot print. It would need basic utilities such as linked lists, vectors and hash tables. It should also have a minimal runtime footprint.
Not exactly a library, but a tested, optimized and documented piece of code: sys/queue.h on *BSD and Linux systems has macros for various kinds of intrusive linked lists and queues.
uthash is a nice hash table library (made entirely of macros), it also comes with a linked list, dynamic string and dynamic array macros.
I also highly recommend sys/queue.h (suggested by larsmans) for simple and well tested linked lists.

Good STL-like library for C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.
The Glib library used on the Gnome project may also be some use. Moreover it is pretty well tested.
IBM developer works has a good tutorial on its use: Manage C data using the GLib collections
As always, Google is your friend:
http://nixbit.com/cat/programming/libraries/c-generic-library/
specifically:
http://nixbit.com/cat/programming/libraries/generic-data-structures-library/
There's some stuff in the Apache Portable Runtime (APR) that I'd expect to be very solid.
Maybe http://sglib.sourceforge.net/ if you want an easy to use, very fast, macro based library.
If hash tables, extensible strings and dynamic vector are enough for your needs, please have a look at the library I put toghether: http://code.google.com/p/c-libutl/.
I also would welcome any feedback!

Resources