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.
There is no such test, but you solved it already. What was the problem?
There is a problem I sure that
the "0" in binary return 0 in dicimal wich in test case should return 32??
I'm Happy to finish this challenge (if I calc the time that I spend to solve It take like 1day or 2day)
??
Yeah you Right about all that.
Thank you for all, I will still work on solution to find it.
Again Thank you
btw, you have an off-by-one allocation error there: you need 5 bytes to store
"word"
, don't forget the nul-terminator that marks the end of the string:{ 'w', 'o', 'r', 'd', '\0' }
yeah, it's complicated to provide better feedback because in C you usually cannot check whether a given pointer is valid or not. so the tests will compare the random pointers in
words_array
and it's likely to lead to a segfault.that being said, i just updated the tests to be more user-friendly:
words_array
will be initially filled withNULL
pointers; and the tests will handle thoseNULL
s safely for both comparison and composing the assertion message. your code no longer crashes now.I know, but the problem in the terminal
I allocat 1 block of 4 bytes to test the "word" but I think when the compare he return my arr with element that I enter manually when is not same. Like "wor" but instead when I enter "word" complet he give me Invalid memory access
you have an array of pointers,
words_array
. it contains as many elements as there are words in the string, but initially (whenwords_to_array()
is called), it does not contain anything meaningful; you have to fill it with strings allocated on the heap (i.e. withmalloc/calloc/strdup()
)I don't know what I should Do.
With C is really challenging
The problem is in the second fun that return the array if should to edit the pointer that store the values or change it like usin for i instead of 0
Ah Sorry about that I don't know the rules of discution.
Thank you Bro
you realized your mistake but forgot to close your question afterwards
Correct
What do you mean ??
OP solved the kata
Loading more items...