Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data structures in C? [duplicate]

Possible Duplicate:
Good STL-like library for C
Are there any open source C libraries with common data structures?

Is there a "standard" library that C programmers use for frequently-used data structures (hash/tree-based sets/maps, heaps, etc.)? Or is there no single, well-known implementation?
(Something kind of like Boost for C++?)

like image 392
user541686 Avatar asked Jan 13 '12 20:01

user541686


People also ask

Can you copy one structure into another in C?

If the structures are of compatible types, yes, you can, with something like: memcpy (dest_struct, source_struct, sizeof (*dest_struct)); The only thing you need to be aware of is that this is a shallow copy.

What is copying in data structure?

A surface copy (also known as shallow copy) simply copies references without creating copies of the data behind them: @original = ( \@a, \@b, \@c ); @surface = @original; A deep copy creates an entirely new structure with no overlapping references.

What is nested structure in C?

A nested structure in C is a structure within structure. One structure can be declared inside another structure in the same way structure members are declared inside a structure. Syntax: struct name_1.


1 Answers

See GLib or APR (Apache Portable Runtime) library, they are the most well-known C libraries for data structures.

http://developer.gnome.org/glib

http://apr.apache.org

like image 171
ouah Avatar answered Sep 30 '22 15:09

ouah