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.
Thats interesting way to do it. Could you explaing how that works? What topics should one cover to understand how it works?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The break statements are not needed and can never be reached.
The break statements can never be reached and are not needed.
I just didn't want to assume, in case you didn't mean it as a question.
Thank you, too!
I may be a
2kyu
in C, but I feel this is generally an unreliable indicator of the depth of awareness of a coder to any partiucular language. Also, I'm100%
self-taught in coding, so I am constantly filling in various gaps. So, thank you for the affirmation of my supposition.I see you're 2 kyu in C so I'm not sure if you're really asking.
There is no guarantee regarding which side of the while statement is evaluated first. The order is undefined. It is up to the compiler to choose, and apparently the same compiler might choose a different order for different runs. My solution is wrong if the left-hand side is evaluated first. In that case the last position in the array will get the second to last multiple value, and the last multiple will be skipped.
You are correct; this prompts a warning:
format specifies type 'int' but the argument has type 'size_t'
.Since count is of type size_t, I think the format specifier should be %zu instead of %d.
Hence the warning
unsequenced modification and access to 'n'
, about which I wonder there is a risk of U.B.Is it because there's no guarantee that one side or the other side of the assignment may be evaluated first?
Undefined behavior since I both decrement n and read n in the same statement, and the order of evaluation is undefined. I could have instead performed the decrement operation in the while condition, since the condition will be evaluated before the rest.
I'm here as a complete noob, so the question
"We need a function that can transform a number (integer) into a string.
What ways of achieving this do you know?"
is none. I know nothing. that's why I'm here. I can't find where to even start.
Good to know. Thank you!
Loading more items...