Designing string tokeniser

Why we have created dynamic array for storing data ,can’t we use static array ,as after some time our heap would get filled by using dynamic array

you can also do that but it will not give correct ans

how will you return the ans??

if you update it and return the ans then previous answer also mixed it with

try to do that you will understand what is the problem