Ad
  • Custom User Avatar

    Wondering if it has something to do with the number being at the start of the word, but that doesn't quite make sense

    But that's exactly it ;-) %[] only matches a non-empty sequence of characters. As soon as the match fails, sscanf() returns, without parsing the integer.

  • Custom User Avatar

    You wrong, because string VOWELS is of constant length (5) and does not depend on an input. So it will be O(n*const) = O(n).

  • Custom User Avatar
  • Custom User Avatar

    also, src == "" does not do what you think it does. In C, use strcmp() to compare strings. Using == compares their addresses in memory

  • Custom User Avatar
    • what are the critical qualities of a C-string?
    • also, read the error messages
  • Custom User Avatar

    Your solution is almost good, but it has some problems:

    • sometimes, it returns a non-freeable string,
    • it does not handle invalid cases correctly (you need to carefully read the description once again).

    Your solution is missing some things, it's not a kata issue.