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.
OP solved the kata (while still returning a stack array from the function, remarkably)
this cannot be considered an issue. checking whether the address is on the heap, stack or .data segment is not supported by standard C and involves UB.
people have already been returning static buffers, so i think it would be unfair to invalidate their solutions
Memory management in C is all over the place. It's not specified how the result string should be allocated, and tests do not follow any kind of an allocation strategy for the returned string.
Your solution returns a buffer which is allocated on the stack, what is an error in C. Your answer needs to be accessible for tests, so you need to return a pointer to a buffer which lives longer than just a call to the solution function.
Hi, I have passed all the preleminary test but when I attempt it returns to me that one random did not pass. The error is :
Expected: found the needle at position 30 Received:
It says to me that I returned nothing but when I printed the array returned in the log and here is what I have :
found the needle at position 30
Which is the correct output.
In the program I wrote I build other function. Is it possible that when we attempt it does not take these function into consideration?