Ad
  • Custom User Avatar

    that remains seperately as a different problem with your code because it doesn't handle every case properly

  • Custom User Avatar

    But if it I don't allocate the memory, it causes a memory access error

  • Custom User Avatar

    In your code, you attempt to allocate memory for the provided char *IPv4 within the function, but it has already been pre-allocated prior to being passed to the function.

  • Custom User Avatar

    My solution for C, sets the IPv4 to the right value with a null value to end it. However when the test is run the intput is shown as a load of random sysmbols such as '@@@@@@@@@@@@@@@@!@@@' etc

  • Custom User Avatar

    you must write to the parameter phnum and return it, instead of allocating a string on the heap

    I added a note in the initial code

  • Custom User Avatar

    My code in C, passes all the sample tests, but when i try to attempt it with the main tests it fails. On the tests screen it says the nums array is just an array with differnet symbols and no numbers.
    My code is making a char array with the right format, and when it returns in the sample tests its correct. But in the main tests nothing gets returned.

  • Custom User Avatar

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

  • Custom User Avatar

    output = testing; - it is not how output arguments work in C.
    Your solution is not entirely correct, it's not a kata issue.

  • Custom User Avatar

    In C. I have wrote to the output variable. When I print it, it holds the correct information but the tests say the output variable is empty.