These are just some of the Arrays sizes i've used, many of them are inside a loop.
int ss[80000]={0};
char pres[64000];
int ith[4096][16]={0},ich[4096]={0},pres2[2500][16]={0};
int slf[4096][16]={0},slr[4096]={0},rh=0,crs[4096]={0},cri=0,moo=0,nb=0;
int qlf[4096][16]={0},wlf[4096][16]={0},kd=0;
int jlf[4096][16]={0},jlr[4096]={0},jrs[4096]={0},jri=0;
int klf[4096][16]={0},klr[4096]={0},krs[1204]={0},kri=0;
int vlf[4096][16]={0},vlr[4096]={0},vrs[4096]={0},vri=0;
int plf[4096][16]={0},plr[4096]={0},prs[4096]={0},pri=0;
80% of the time my program runs properly but every other time it suddenly stops executing and closes the program unexpectedly and after debugging i always find out that one of the counters for the array has gone way off the limit, like ith[4096][16] will have values uptil ith[6400(counter)][16].
I also can't declare the size as a high upper limit of 6400 as the program refuses to run if i do this with every array. I thought about using Dynamic array but i've never used them before and am not sure of the right way to do it. I"ve seen a few examples online but my problem is the counter variable increases in different parts of the program including loops while processing the ith[][] variable itself it may increase its size, how do i define it then
int * ich;
ich = new int [Counter];
What about Multi-dimensional pointers with one fixed varaible ?
int ** ith;
ith = new int [Counter][16];
or
ith =new int*[counter];
for(int i=0; i<16;i++){
ith[i]=new int[16];}
Are there better ways of solving my problem other than dyanmic array ? Can i constantly change the size of the arrar by using Dynamic allocation ?
What about Vectars ? Is it relatively easier to implement for an amateur?