Your mission
Write int_vec_push, which appends value to a heap array of int and moves the array to a block twice as large when it is full.
See it in action
5 pushes (10, 20, 30, 40, 50) on an empty arraypush 10: ret=0 len=1 cap=4 moved push 20: ret=0 len=2 cap=4 same push 30: ret=0 len=3 cap=4 same push 40: ret=0 len=4 cap=4 same push 50: ret=0 len=5 cap=8 moved [10,20,30,40,50]push 4 on a full array {1, 2, 3} with cap 3push 4: ret=0 len=4 cap=6 moved [1,2,3,4]push 9 on an array that cannot grow (malloc returns NULL)ret=-1 data=same len=same cap=same values=7,8
Your checklist
Constraints
- Expected file
int_vec_push.c- Allowed functions
mallocfree- Allowed headers
<stdlib.h>declares malloc and free<stddef.h>defines size_t and NULL
