Ad
  • Default User Avatar

    Concerning data1, I assumed it is a string like data, but with different cities or records. However, as I didn't solved this kata yet, I can be wrong !
    Concerning the definition of data in C, the '\0' is automatically added. For exemple, char string = "hello" ; creates a string of 6 char : "hello\0".

  • Default User Avatar

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

  • Default User Avatar

    I try to code this kata with C. I don't understand why in the test cases, my results are transformed in nonsense by the array2StringInt function, when the function works just fine with the array of expected results, and also with other arrays I tried. So I'm lost somewhere in these 3 line (and the return of the race function I wrote probably ?) :
    int act = race(v1, v2, g);
    char
    sact = array2StringInt(act, 3);
    char* sexpr = array2StringInt(expr, 3);

    The error is : Error. Expected -1, -1, -1 but got 27076368, 0, 27076368
    The numbers after got are never the same, they don't match the adresses, I checked that and a few other things, with all the test cases proposed...

    I got back to my books about C, and arrays, and pointer, and I found no ideas. My algorithm is okay, I got the correct values when I print them and it works when translated into Java.

    Does anyone have an idea about what I should do / try / test ? Did someone had the same issue in C ?