why cant i use the static array for ouput array
and how is output pointer points to the dynamic array
Use of dynamic array
the code is from the video on creating out own strtok function, i dont have the code with me
hey @shiva57reddy, when we pass a string as an argument to strtok function, it extracts the required word from this string.
when we pass a NULL as an argument to strtok function, it extracts the required word from previously sent string.
In order to use this string for future use, we take dynamic array because it remains in memory even after the end of function.
When we create a dynamic array, we have to store its address in order to access it. Here output pointer is doing the same thing i.e. storing the starting address of dynamic array created in heap memory.