Merge pull request #106 from wustzjf/patch-1

Update array.c
This commit is contained in:
wangzheng0822 2018-10-26 10:38:06 +08:00 committed by GitHub
commit 484524efc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ int insert(struct array *array, int elem)
}
if (idx < array->used)
memmove(&array->arr[array->used], &array->arr[idx],
memmove(&array->arr[idx+1], &array->arr[idx],
(array->used - idx) * sizeof(int));
array->arr[idx] = elem;