October 27th, 2002, 3:03 pm
Thanks for the responses.yeah, I like mj's method! But here's another one for you guys:I have to create a LARGE array, which I am doing using a pointer.double* A;A = new double[n]; where n is a HUGE number, it can be more than 400 million. This is not running properly and I think it may be due to an issue with memory. Take n and multiply by 8 bytes (each double variable in the array needs 8 bytes for storage) and this gives the memory needed for storing the array. My question is, where is the free store? Is it the RAM or the hard drive? For instance, if I need to store 400 million double variables, this works out to 3.2 GB. My computer has 128 MB RAM, but 30 GB hard drive... so is this why the program keeps failing? Because I dont have enough RAM?On a separate note, if I wanted to assign values to the array usingS = ...then does i have to be of integer type? Can i assign the value S[3] by using S[a] with a defined to be a double with value 3? It seems to work ok, but I am wondering if there are any implications which I have not considered.Thanks for your help,Sam