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.
@caelumable, temp is merely a pointer. It points into same chunk of calloced memory that
final
points at.That memory will be freed in the test code.
EDIT: My mistake, the test code doesn't free the returned memory at all. I guess the author wrote code in this way to allow solutions this return references to static variables.
eum....may I ask when dose the temp be destroyed? and why ? the temp didn't declear in the domain of the for loop, why it destroyed after the for loop?
temp pointer is incremented in a for loop, if you want to return it you should decrement it same amount of times because, as @status stated, it points to nothing after for loop.
Because temp pointer point to nothing now.
Because temp pointer point to nothing now.
This comment is hidden because it contains spoiler information about the solution