working on insert list

This commit is contained in:
Andrew Lalis 2017-05-23 18:29:13 +02:00
parent f8cc4c0a2b
commit dad33e0587
2 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,9 @@ void TEMPLATE(add,LIST_NODE)(LIST_TYPE data, LIST_NODE* list){
Insert List; Insert List;
Inserts an item at the given index, so that the item can be retreived with the get function at that index. Inserts an item at the given index, so that the item can be retreived with the get function at that index.
*/ */
void TEMPLATE(insert,LIST_NODE)(LIST_TYPE data, int index, LIST_NODE* list){
}
/* /*
Get list item: Get list item:

2
test.c
View File

@ -21,6 +21,8 @@ int main(int argc, char* argv[]){
add_float_list(8.0, l); add_float_list(8.0, l);
printf("%d\n", size_float_list(l)); printf("%d\n", size_float_list(l));
printf("%f\n", get_float_list(3, l)); printf("%f\n", get_float_list(3, l));
insert_float_list(15.05, 2, l);
printf("%f\n", get_float_list(1, l));
free_float_list(l); free_float_list(l);
} }