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.
Braces are optional (and therefore not used here) when there is only one statement inside the loop block. This implies that the return statement executes only after the while loop has completed. Hope this helps.
I know this is old but if it were in the while loop, then it would return the list as it is after the 1st loop because how the return statement works. once you return something, you are exiting out of the program and it does not go back. You only want it to return once you know you have the full correct answer at that point.
Think of it as any method that returns either a 1 or a 0. The implementation of it in this case is arbitrary since it is implemented by the caller and not within the method that is being tested.
This comment is hidden because it contains spoiler information about the solution
they're 3D, not 2D ;-) your box would be 2 * 1 * 0
In the Details, It says that a 2 * 1 * 1 box will have 20 edges.
Shouldn't it be 7?
Why does this have a return type of
char *
if in the end the return value is voided and it needs us to modify the pointer instead?The explanation was great, and all my doubts were solved!
Hi,
Here pass the address of res (this is the reason for &res, it is required by asprintf), then store the string in res.
This function is similar to sprintf, the difference is you don't have to worry about allocating the space needed to hold the string, asprintf takes care of it directly for you.
For more details see the links below:
https://c-for-dummies.com/blog/?p=3934
https://linux.die.net/man/3/asprintf
Remember that the difference between &res and *res is as follows:
&res returns the address of res.
*res returns the first character pointed to by res.
I hope I was helpful :)
That's basically what i did as well, but i really like how you wrote it.Nice one man
That's very clever man. GJ
This comment is hidden because it contains spoiler information about the solution
what does func do?
I don't get what the Predicate is exactly. I know what typedef does
In Java it is needed to avoid integer arithmetic. But here maybe it was redundant.
what is the . after the 100 for?
Loading more items...