Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
char *words_array[]
is an array of strings that you have to fill with the words in the input stringwords
.words_array
is an output parameter that does not initially contain anything meaningful. You have to allocate memory on the heap (malloc()
& friends) for each word.words_array
itself is necesarily already allocated, otherwise it would be impossible to pass it as a parameter.Your code does not NULL-terminate your output, so that causes undefined behavior outside of your function.
agreed
Read the posts below, like this one: https://www.codewars.com/kata/5899dc03bc95b1bf1b0000ad/discuss#637b0f6d8ee59335c37afbe2
The expected answer is fine. That number has no zeros at the end.