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.
This comment is hidden because it contains spoiler information about the solution
Yes, I think that was my reasoning for the 2x (It's been a while).
Any overreach is cleaned up by the
realloc
at the end so I am not left holding more memory than was actually needed.This comment is hidden because it contains spoiler information about the solution
the memory space to which you are writing is not guaranteed to not contain integer values other than
0
, so whatever happens to be there becomes part of the c-string result automatically, given that there needs to be a null terminator to define the end of a c-stringIt's actually already a pointer, and
*text
dereferences it, same astext[0]
, but with the benefit of allowing the post-increment operator. (Hmm, willtext++[0]
work? I forget.)