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.
This Kata is specifically designed to be solved in the C language, where the use of null-terminated strings (C-strings) is fundamental to the challenge. While I understand the suggestion to make the title more explicit by referencing C-strings, I believe the current title is sufficient. Since this Kata is limited to C, and strings in C inherently follow the null-terminated convention, the title should not cause confusion within its intended context.
I still recommend adding something about null-terminated strings (or C-strings) to the title to avoid confusion. This kata isn't really about the general concept of strings in informatics; it's focused on a specific type of it.
I have made a Kata based on the Kumite that I started. If you want to go check it out, here's the link: https://www.codewars.com/kata/66ca80460f2a3f128a865cc5/c
No one is working together on some ultimate programming project in this thread. This is Codewars. Just have fun and do stupid shit. Nobody said this code was an improvement; it's just another submission.
How is making the code unreadable an improvement? Most code is meant to be read by others, and good C formatting is a virtue.
Hi, I replied on email 😉
added to PHP
removed
const
qualifier???
What you did in those two last lines of code is crazy. I am still trying to wrap my head around it.
Prototype should not use const type for parameter
n
in C translation, that makes no sense at all.can you provide a test case that this solution would fail ? ;-)
Random tests are needed (at least in C). This solution shouldn't have been accepted: https://www.codewars.com/kata/reviews/633ecc4a0b4d8d0001547ed6/groups/633ecc4b0b4d8d0001547edb
you have a memory leak.
Brain fart on my end. I initially wrote the tester and used const int for the index
n
to ensure it wouldn't be modified within the scope of the tester. I carried over that same approach to the function definition, but you're right — sincen
is passed by value and not by reference, making it const doesn't serve any purpose in the function prototype.I've corrected the prototype based on your suggestion!
Loading more items...