concerning this question on how to allocate memory without using new or malloc, suppose I have a structure linked list
struct stack {
string info;
stack next*;
};
The answer provided says use global byte array. How would I implement an linked list by allocating to global byte array?
One way is to have a memory pool declared in data segment and have your own memory allocation function.
And you have to write your own memory manager:
Usage:
Or more precisely,
Usage: