Ad
  • Default User Avatar

    The user solution and the tests are in different files that are compiled separately. After compilation to object code, there are no datatypes or functions anymore; the linker will just look for something named char_of_code that is supposed to be callable. "WXÀ" is encoded in UTF-8 with bytes \x57\x58\xc3\x80. A disassembler shows that these bytes correspond to the x86_64 assembly code:

    \x57: push   rdi
    \x58: pop    rax
    \xc3: ret
    

    which essentially acts like a function that returns its input.

  • Custom User Avatar

    anyways it's gonna compile into the same machine code as "if-else" chain or "switch" xD