Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
|
This is simple and generic dictionary. You can instantiate multiple dictionaries with the constructor. See interface below.
Each dictionary has space for 1000 elements.
You need add the files dic.c and dic.h in your project directory. After that you include dic.h
create_dict: is a simple constructor for creating a dictionary and setting up the member field 'number_of_elements' and prepares the inner array 'elements'
add_item_label: adds item (void*) to the dictionary at given label returns 0 if adding was sucessful otherwise -1
add_item_index: adds item (void*) to the dictionary at given index (int) returns 0 if adding was sucessful otherwise -1
get_element: returns the element at given label
get_element: returns the element at given index
simple destructor function for avoiding memory leaks.