I need to allocate an array of N elements in my program.
I have gone through and (hopefully) understood the basics of different types of arrays in Symbian:
My requirements are:
i) N (number of elements) is some large number known at "runtime".
ii) Allocation must be done on heap
Something I would do in normal C++ like:
int N = get_number_of_elements(.....);
int *my_array = new int[N];
In Symbian, it seems to me that:
1) RArrays - We cannot allocate a chunk of memory at once. The only way is to append "element by element", which may require many "resize" operations on the allocated memory.
2) TFixedArray - Size must be known at compile time (In my case, N is only known at compile time).
What is the best way for me to achieve this (rather simple) task of allocating N elements in one shot, where N is known at compile time.
(Note that I would also prefer to have in-built sort functionality, like in RArrays).
Thanks for the patience for this rather simple question and your help!