Ad
  • Default User Avatar

    When your code is run, there is an error message: undefined reference to dontGiveMeFive. This shows the fundamental problem with your code, it does not contain the original declaration of the function that was present when you began the kata, so you deleted that code at some point. Here is what that code looks like:

    int dontGiveMeFive(int start, int end)
    {
      return 0;
    }
    

    Notice that it is passed two parameters, so you will not need to use scanf() in your code. Also your code does not need a main() function, as the dontGiveMeFive() function will be run by the testing suite to see if it returns the correct value. And, this is the final point, that your code should return the value, not print it.

  • Custom User Avatar

    You'll never solve it if you use scanf and your own made up function names.

  • Default User Avatar

    Hello @ChristianJesus, you should know that positing code like this is forbidden, because everyone can see it on the open comments section, (I have added the spoiler tag to your comment).

  • Custom User Avatar

    Lol. That's just desperate. Hint: use an array.

  • Custom User Avatar

    No, but you can forfeit the kata and see all the solutions without gaining any honor point.