Usually, you use first malloc then realloc, but it is not a requirement, since realloc can work just like malloc.
And just a heads up - but there is C++, if what you do allows it. Similar to Java, but also an evolution of C.5. I usually program in Java, there's no problems with memory allocation or strings but in C they are entirely different. That's why I was so confused at first.