123
This commit is contained in:
commit
115d308b5f
@ -5,6 +5,7 @@ list_t *new_list(size_t length, list_element_t elements[]){
|
|||||||
list_t* list = (list_t*)malloc(sizeof(list_t) + length * sizeof(list_element_t));
|
list_t* list = (list_t*)malloc(sizeof(list_t) + length * sizeof(list_element_t));
|
||||||
list->length = length;
|
list->length = length;
|
||||||
memcpy(list->elements,elements, length*sizeof(list_element_t));
|
memcpy(list->elements,elements, length*sizeof(list_element_t));
|
||||||
|
<<<<<<< HEAD
|
||||||
free(list);
|
free(list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -53,4 +54,4 @@ list_t *reverse_list(list_t *list){
|
|||||||
|
|
||||||
void delete_list(list_t *list){
|
void delete_list(list_t *list){
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
#ifndef LIST_OPS_H
|
#ifndef LIST_OPS_H
|
||||||
#define LIST_OPS_H
|
#define LIST_OPS_H
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user