From 9768c0678764fe64d8200802cff140671b6bb5a5 Mon Sep 17 00:00:00 2001 From: Kapliuk Date: Wed, 13 Mar 2024 16:09:47 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D0=B8=20'c?= =?UTF-8?q?v4/list-ops/list=5Fops.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv4/list-ops/list_ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cv4/list-ops/list_ops.c b/cv4/list-ops/list_ops.c index 0c7dd34..bf8ce3e 100644 --- a/cv4/list-ops/list_ops.c +++ b/cv4/list-ops/list_ops.c @@ -1,8 +1,10 @@ #include "list_ops.h" list_t *new_list(size_t length, list_element_t elements[]){ - return NULL; - + list_t* list = (list_t*)malloc(sizeof(list_t) + length * sizeof(list_element_t)); + list->length = length; + memcpy(list->elements,elements, length*sizeof(list_element_t)); + return NULL; } list_t *append_list(list_t *list1, list_t *list2){