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.
Is it a good idea to guarantee a value of 0? Does it lead to a good practice?
As one of the commenters pointed out, there was at least one case when that wasn't true (which could cause a lot of current solutions, ignoring count, to overflow).
And if there is a reason behind it, then why bother with ARRAY_SIZE macro and passing count at all?
(Is that, perhaps, the way we bait for 'clever' sollutions here?)
The point of this was mostly just an excuse for me to have some fun golfing with no fear of undefined behaviour, sorry for not making that very clear.
Now I may be wrong here, but since when does malloc initialize contents of memory? AFAIK it could, but doesn't have to, and malloc(0) is a very specific case (implementation dependent) - it may either return NULL or a non-NULL pointer.
https://softwareengineering.stackexchange.com/questions/411166/why-would-you-ever-use-malloc0
I do believe that "already being a NULL was lucky" applies to your code as well - IMO both cases passed the test thanks to linux kernel.
https://stackoverflow.com/questions/45323930/is-malloc-initializing-allocated-array-to-zero
AFAIK the correct option should use calloc.
(Also your code could use some whitespaces after comas and semicolons or around operators . Readability is quite poor.)