www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How to use large size array, which are array

reply "Sparsh Mittal" <sparsh0mittal gmail.com> writes:

I read: "The total size of a static array cannot exceed 16Mb. A 
dynamic array should be used instead for such large arrays."

I want to make array which is shared but also has a large size, 

      shared WorkerClass[numberOfWorkers] myWorkerArray;

where numberOfWorkers is large.

If I try to do:

      shared WorkerClass[] myWorkerArray;
      int main()
        myWorkerArray = new WorkerClass [numberOfWorkers];

the compiler does not allow me to do so.

My motivation is to create a global array, which I can use in 
multiple functions which are created using "spawn".

Can you please help me.
Jan 27 2013
parent "Sparsh Mittal" <sparsh0mittal gmail.com> writes:
Oh, I need to delete this thread, since there was an error. I did 
not know how to edit, so I created another thread. My apologies.

Please delete it and read another one.
Jan 27 2013