Try double*** Test = newdouble[NumOfTester][NumOfParts][ColData](0);
Which will create a dynamic 3D array with contents initialized to zero.
The issue here is that if NumOfTester is 100, NumOfParts is 50 and ColData is 25... you'll store 100*50*25*8 (assuming x86 architecture) bytes of memory. Thats 1 MiB...
:0)
It is a MB in 'decimal' SI units but not the 'binary' SI units. You would be better off saying 0.95 MiB to avoid confusion. It was better back in the day when computer people knew if you said kB* you meant 210 and not 103.
The way I've learnt it is that one MegaByte is 1000 kiloBytes; which is 1000 bytes. One MebiByte is 1024 kibiBytes which is 1024 Bytes. 1000 * 1000 (1 MB) is equal to 1,000,000 and so is 100 * 50 * 25 * 8. 1024 * 1024 is equal to 1048576, as you pointed out.
double*** Test = new double[NumOfTester][NumOfParts][ColData](0);
I got errors when I compiled the above code.
The errors were:
line 420: Error: C2501E: 'new' <array> initialiser ignored
line 420: Error: C3028E: <initialisation>: implicit cast of pointer to non-equal pointer
The way I've learnt it is that one MegaByte is 1000 kiloBytes; which is 1000 bytes...
Context is all important here, for example; if you go to a computer manufacturer, the spec for a PC may have 4GB of Ram and a 500GB HDD. Now the GB for the RAM is going to be 230 but the GB for the HDD is likely to be 109 and the OS may well report the drive size in terms of 230.
Somewhere around the year 2000, the IEC introduced the *bi prefix to try to work around this duality in the SI system (technically I don't think the binary version was ever official SI, more de facto) but I don't think it has taken yet, I hardly ever see the *bi prefix used.
The only reason I bought it up is because I believe it is important to know
@GreyWolf
Do I need to deallocate the code you posted using vector? or is it a stack-based vector? since there were no "new" keyword. thanks.
@augustorighetto
Thanks for the reply.
Hmm.. the problem is.. I don't want to use other libraries just standard libraries only.
Correct me if I'm wrong, if you included boost or other libraries except for the "default" libraries others should include also that libraries in order to execute the program am I right? thanks.