Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1And in Conclusion\dots

C does not automatically handle memory for you, so it’s up to you, the programmer, to allocate, use, and free memory correctly. In each program, an address space is set aside, separated into 2 dynamically changing regions and 2 ‘static’ regions.

There are a number of functions in C that can be used to dynamically allocate memory on the heap. The following are the ones we use in this class:

Be careful when allocating buffers on the stack and heap! The heap is the biggest source of subtle bugs in C code.

Take CS 162 for more!

2Textbook Reading

K&R 7.8.5, 8.7

3Additional References