In this blog post, we’ll explore dynamically allocating memory for an array in C. In particular, we’ll see why the idiom of malloc(3)’ing memory equal to the number of elements in an array multiplied by the size of each element should be avoided, and why calloc(3) should be used instead.