Quantcast
Channel: C++ allocating memory using array - Stack Overflow
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

C++ 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
Browsing all 4 articles
Browse latest View live




Latest Images