Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
that remains seperately as a different problem with your code because it doesn't handle every case properly
But if it I don't allocate the memory, it causes a memory access error
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.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
you must write to the parameter
phnum
and return it, instead of allocating a string on the heapI added a note in the initial code
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.
This comment is hidden because it contains spoiler information about the solution
output = testing;
- it is not how output arguments work in C.Your solution is not entirely correct, it's not a kata issue.
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.