A linked list. Every struct has a pointer to the next one. Right? I'll look it up. Thanks.You would probably do this using a linked list. I recommend Algorithms in C by Robert Sedgewick for an introduction in linked lists, binary trees, searching, etc.
Since this is a Mac programming forum, you could also check out some Cocoa API like NSMutableDictionary.
http://www.cprogramming.com/tutorial/c/lesson15.htmlA linked list. Every struct has a pointer to the next one. Right? I'll look it up. Thanks.
http://www.cprogramming.com/tutorial/c/lesson15.html
Then you have to think about do you want to traverse the list in both directions, do you want it to loop around when you hit the end, how do you add/remove/replace nodes...
I'd suggest finding a library that already has done this for you.
(or using a language that has lists as a built-in type )
A linked list. Every struct has a pointer to the next one. Right? I'll look it up. Thanks.
MyStruct * struct = (MyStruct *)malloc(sizeof(MyStruct) * no_of_elements);
struct = (MyStruct *)realloc(sizeof(MyStruct) * new_no_of_elements);