Chapter 7. Run-time Memory Allocation

Requesting memory at run-time

7.1. Why you need this

Often when you write a program you don't actually know how much data is will have to store or process. In previous examples we've read in some text from the user. We've used large character arrays to store this data but what happens if the user enters more text than we can handle? your program crashes. Disaster. At run-time an application can make a request for more memory.