Answer by James Kanze for C++ allocating memory using array
It's not too clear what the question is supposed to mean. You couldjust declare a large block of stack, and use them, perhaps using a bitvector of some sort to keep track of which ones are free or not,...
View ArticleAnswer by iammilind for C++ allocating memory using array
One way is to have a memory pool declared in data segment and have your own memory allocation function.char myMemoryPool[10000000]; // global variable (can be enclosed in namespace)And you have to...
View ArticleAnswer by Ben Voigt for C++ allocating memory using array
Instead of a pointer, use an index into the array. (Actually, a pointer is nothing but an index into the byte array representing all virtual memory). You'll have to keep track of which indexes (or...
View ArticleC++ allocating memory using array
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...
View Article