|
|
back to boardWhy does my code fail? I create a struct STACK like this: struct STACK { int number; unsigned char before[3]; }; and keep arrays: STACK LIST[100000+1]; int last[1000]; Apparently (3B+4B)*10^5 = 7*10^2 KB which is less than 750 :D whats wrong with it? :/ how much memory does an empty cpp code consume? Re: Why does my code fail? UPD: now I use these arrays and structs: struct STACK { int number; unsigned short before; }; int last[1000]; int counter = 0; STACK *LIST = new STACK[100000+1]; int tmp = -1; string strr("PUSH"); int additional_bit[3200]; char STR[5]; and still MLE XDXD btw, an empty cpp code uses ~80KB which is OK for my code but why does it still fail?:/ Re: Why does my code fail? I think your struct is packed by compiler into nearest div 4 byte blocks, i.e. into 8byte blocks. Try to use arrays instead or search for additional compiler options |
|
|