I have been using C for over thirty years, and I have never once called calloc().
@phooky some people like it because unlike malloc() it initializes all new memory to zero, and i guess the two parameters avoid potential overflows with malloc(num * sizeof(thing))
It's my go to over malloc() because initializing the contents to zero makes accidental dereferences much more predictable.
@phooky It's my standard use, except when I *know* the buffer will be overwritten immediately. And maybe even then, calloc is safer.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!