Ad
  • Custom User Avatar

    Yes, I had this issue when trying to come up with in inplace solution and realised a string literal is passed in.

    The function signature should read char *DuplicateEncoder(const char *str); to signify that the argument is immutable.