Ofcourse can you do it in C and yourself, when using the
realloc function which enhance the allocated memory block. If it is a homework than ask your teacher if you are allowed to use some github code.
But be aware that you better understand the
memory allocation model of C.
Dont believe anybody that "you cant do that in C". Never, ever believe such filthy lies ;-)