CIS3355: Business Data Structures in C/C++
Dr. Peeter Kirs
Dynamic Memory Allocation
Short Answer/Problem Questions
NOTE: Checking the answers before you have tried to
answer the questions doesn’t help you at all
1000. What are the
advantages of allocating memory dynamically?
Assume that
we created the data type:
Struct mydata
{
char
name[20];
short DOB;
struct
mydata * next;
};
And then we
associate a variables with the data type struct mydata:
Struct mydata * newdata, * firstdata, * lastdata;
1050. How do we
request RAM dynamically?
1070. How much RAM
would be given to us?
1090. How do we know
that we will get the memory requested?
1100. Suppose we wish to link records together. EXPLAIN how we would go about doing it.
1110. Illustrate (graphically) how three records
might be stored in RAM
1120. How do we free-up memory when we no longer
need it?
1130. What is the procedure needed to remove a record
from a list?