Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Ignore this, it contains old comments. I need to delete it.

  • Default User Avatar

    Clever one liner! All the types must be correct, because they're all hidden as return types, and the compiler would easily spot mismatches - nice move.
    The memory saved on not having any automatic variables is probably cancelled out by the stack space (and probably lots of time creating nested stack frames) for all the repeated string function calls.
    Arguably the repeated calls to strlen could be optimised by the compiler, but really who trusts the compiler.
    Personally, I had to cast to char * when I added a size_t to my const char *, but from your solution maybe that was only needed to fix the mismatch of pointer const-ness.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution