How do we use malloc to allocate storage for an Array?

Common Pitfall: Not using sizeof to Determine Element Byte Size


What is the calloc Function for?

What’s the syntax?

When should we use calloc instead of malloc?


What is the realloc Function for?

What’s the syntax?

Common Pitfall: Using realloc On Anything Outside Dynamically-allocated Objects

What are the different Rules of realloc?

How does realloc work exactly when downsizing or enlarging blocks of memory?

Common Pitfall: Losing Values after enlarging Array with realloc