Ad
  • Default User Avatar

    This might help streamline your code: The input will be a lowercase string with no spaces. I'd malloc the strings thus: (stringLen + 1) * sizeof(char). Nonetheless, this code would work if you handle your C-strings correctly.

  • Default User Avatar

    can't tell exactly without seeing your code, but my bet is on whether you allocated memory correctly. you may post your code with proper markdown and a spoiler tag, and I can take a look for you.