I do not know whether the topic highlights my question correctly. However, this is my question. I have a fixed sized array. I feed data into the array using the console. When the array is full, i need to create a new array of same size and begin to fill that array. I do not want to expand the existing array or to declare an array of a larger size. In addition I want to delete those arrays if they get empty. This is related to modeling of hardware memory using C++. That's why I want to use arrays with a fixed size to represent memory blocks.
I have to use manual memory management here. I am trying to model the memory management system in hardware systems. what I want to do is something like this.
DataType array[1024];
int i;
while(True)
temp = read_console_input();
array[i] = temp;
memory_manager();
endwhile
function memory_manager()
if array.is_full()
DataType array1[1024] = new Datatype[];
set_active_array(array1);
endif
endfunction
Thanks