Ad
  • Custom User Avatar

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

  • Custom User Avatar

    str[i] = str[i]*str[i]; looks incorrect as well. You are squaring a character with ASCII values between 48 and 58. Since 48 * 48 > 255, the answer placed into that character spot in the string would be unusable. Likewise, changing the characters to their integer value wouldn't be sufficient since the square of numbers greater then 3 would need two characters to be correctly represented in the string.