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.
While doing the C version, I get an error where my output seems to be exactly the same as the expected. It says expected but got the (what looks like) the exact same thing. I havn't worked with wchar_t before, not sure if I am missing something.
I thought pow only accepted doubles? I see it works, I am just not quite sure why. Wouldn't there be a danger of pow() returning a double just below the proper integer and then by casting it to an int, it would round down it in the result?
return calloc(1, 1);
is just a stub so that the initial solution compiles and behaves normally. it also illustrates what kind of string you need to return in your solution: it has to be nul-terminated and heap-allocated (i.e. viamalloc()
&co).calloc(1, 1)
is a construct that creates a heap-allocated empty stringto pass the kata you will of course have to return another string
I would say I understand what calloc does, but I have never seen it used in a return statement.
I would just make a char *returnstr, allocate memory to it with malloc/calloc, and then return that returnstr?
Do you understand what you need to return in C version of the kata?
Do you know and understand what
calloc
does?In C, how am I to supposed understand the return calloc(1, 1)? I have never seen this in a Kata before, but I am also kind of new.