25.9.5
This website uses cookies to ensure you get the best experience on our website. Learn more

Functions and Memory in C: Allocating Memory on the Heap

Skillsoft issued completion badges are earned based on viewing the percentage required or receiving a passing score when assessment is required. C programmers can commonly use two kinds of memory: stack and heap. While stack memory is used to store local variables and is fully managed by C, it does have major limitations that are mitigated by heap memory. In this course, you will compare stack and heap memory, exploring the advantages and limitations of each. Then, you will allocate memory using the malloc() function and deallocate memory using free(). Next, you will examine dangling memory issues that can cause potentially dangerous security issues. You will also explore other common allocation functions like calloc() to zero out memory and realloc() to help when you underestimate how much memory an array will require. Finally, you will focus on pointers to struct objects. After completing this course, you'll be able to allocate memory malloc, calloc, and realloc; free memory; use pointers to structs; and avoid problems related to dangling pointers and memory leaks.

Issued on

September 1, 2023

Expires on

Does not expire