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.
Translation mistake. No more rounding needed.
And could you stop writing these comments please? If somebody doesn't know something, (s)he checks the documentation / searches for the answer on the internet / asks for help /
get the answer from correct logical assumptions at the very least, but you're not even trying.No, that's how you initialize an empty string. Do something with it inside your loop now.
Avoiding it won't help for sure ;)
std::string count = "";
and try figuring out the rest ;)You have the same problem you had in the other kata, why don't you try using a string instead of an array of chars?
.
Try the first results of googling
c++ std::string
.You're not null terminating the char[] properly, so your answer includes trailing garbage. Either initialize the whole array to null chars, insert a null char at the correct index, or (best option) replace the char[] with a std::string and read up on the methods for that class. As FArekkusu said, you're tackling this like a C coder rather than a C++ coder. :-)
Just write it in C++, because this is C code.
I don't think that's the problem, the problem is you create a char array with a length greater than the one that you really need, so at the end you have garbage values in it. I've fixed your code and it worked, so, try to fix it yourself now that you know the cause.
You're returning char instead of string.
My knowledge about C++ is very limited, but it seems it's a problem with your code (I've used another code that works), you'll have to wait for a more experienced C++ programmer to help you with it, sorry.
Without actually seeing your code I can't tell. If you do post your code here, use the
Mark your code as having spoiler content
checkbox and use proper markdown (for C++ it's cpp)Not here, try gitter channel, I'm not always there tho. But you can get help from someone else too.
Make sure your function returns a result instead of printing it.