Hi everybody,
I have a curiosity/problem about the dimension of my arrays.
I'm programming under linux & windows & mac, in a mathematical program.
So I need to use arrays and vectors like:
1 2 3
|
#define N 1000.....
double a[N];
double b[N][N];
|
But the problem is N. On my Linux I can use N < 1000000 (with g++), on Windows I arrive at N < 10000.
1) I understood that de max. dimension of my array depends of:
a) OS/Hardware limitations with I use a Dynamic Array like:
double *a = new double[N];
b) OS/Hardware + compiler stack size if I use a static array.
Is it correct?
2) Now if I use dynamic arrays, how can I determine (with precision) the maximun dimension (N) of my array that I can allocate, using C++ (or Qt classes)?
NB: My application will get vectors from user, so I would like to determine the OS/Hardware "limit" (before add data) and show a warning.
3) Is there some method/technic in C++ to allocate arrays with "infinite" dimension?