Ad
  • Custom User Avatar

    Idk what you're doing but the C++ version works fine.

  • Custom User Avatar

    Yep, does not compile whatever...:

    main.cpp:19:22: error: no matching function for call to 'DetermineBase'
            Assert::That(DetermineBase(log), EqualsWithDelta(M_E, 1e-12));
                         ^~~~~~~~~~~~~
    main.cpp:8:8: note: candidate function not viable: no overload of 'log' matching 'std::function<double (double)>' for 1st argument
    double DetermineBase(std::function<double(double)> func){
           ^
    main.cpp:20:22: error: no matching function for call to 'DetermineBase'
            Assert::That(DetermineBase(log10), EqualsWithDelta(10, 1e-12));
                         ^~~~~~~~~~~~~
    main.cpp:8:8: note: candidate function not viable: no overload of 'log10' matching 'std::function<double (double)>' for 1st argument
    double DetermineBase(std::function<double(double)> func){
           ^
    main.cpp:21:22: error: no matching function for call to 'DetermineBase'
            Assert::That(DetermineBase(log2), EqualsWithDelta(2, 1e-12));
                         ^~~~~~~~~~~~~
    main.cpp:8:8: note: candidate function not viable: no overload of 'log2' matching 'std::function<double (double)>' for 1st argument
    double DetermineBase(std::function<double(double)> func){
           ^
    1 warning and 3 errors generated.
    
  • Custom User Avatar
  • Custom User Avatar

    I've edited how k was generated, it should be fixed now for both C and C++. Mark as resolved if it is.

  • Custom User Avatar

    k should be less than n because the balls are numbered from 0 to n - 1.
    C++ has also the same problem.

  • Custom User Avatar

    @danderle ..

    • That's what i've bet , Unfortunately :disappointed: :disappointed:
    • The C Translator has been inactive for pretty long time , I've mentioned him 1 month ago Check Here, also (You can see Below :point_down: :point_down: , another issue raised concerning C Translation hasn't been resolved Yet ) :disappointed:
    • So if you could translate it into C Language and Leave me a link with it so i can approve and overwrite the current bugged one I'll be grateful :blush: .. Tuned .. Regards .. Zizou
  • Custom User Avatar

    @danderle ..

    • Well , thanks Bro for pointing out , I Think You've attempt the kata either in C or C++ but the odd thing is Both of them has been completed 16 and 42 Times Without an issue raised :exclamation: :exclamation:
    • So for more help , Could you please name the language that you've attempt in letting me mention its translatoe to fix the problem
    • I'm tuned to hear your feedback :blush: .. Hope you all the best .. Regards .. Zizou
  • Custom User Avatar

    Changed the comment in the initial code, now it says:

    /* Please make sure you report the count of elements in the memory pointed to by pResultCount,
       even if the result might be {"None"}. */
    
  • Custom User Avatar
  • Custom User Avatar

    You need to return an array of elements, where is the memory for that array allocated?

  • Custom User Avatar

    The problem is with the optional parameter. He/she hasn't defined it in the function.

  • Custom User Avatar

    25 people solved it in c++, any clue what the problem might be now?