Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Default User Avatar

    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. via malloc() &co).

    calloc(1, 1) is a construct that creates a heap-allocated empty string

    to pass the kata you will of course have to return another string

  • Custom User Avatar

    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?

  • Custom User Avatar

    Do you understand what you need to return in C version of the kata?
    Do you know and understand what calloc does?

  • Custom User Avatar

    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.