   Loading large array data
  I have some large array data I would like to load, but I think it is crashing myprogram.  I have it in an initialization array form:FLOAT mydata[NUM_DATA][3] = {{ 1.324234f, 3.123123f, 0.454353f },{ 4.345345f, 2.789789f, 1.786787f }, etc...At first, I had this defined in a local function that used it, but for some reason, it crashedmy program.  I then made it global, which seemed to help.  The only problem with that, isI don''t want to waste global memory like that.Is there any other good way to load a large prefined array into allocated memory? 
  When you initialize an array like that in a C or C++ program, the entire array is stored in a data segment in the executable image. If the array is a global then manipulating the array happens with direct access to the data. If the array is a local variable, room for the array gets allocated on the stack and the data is copied on to the stack from the data segment. So by using a local variable you''re actually using more memory and getting a performance hit when the copy is performed. Also, if your array is big enough it will overflow the stack and crash your program (which could be one explanation for why your program dies).If you only want memory allocated when the array is in use and not otherwise, you can either embed the array in a dynamic library and unload the library when not in use, or you allocate memory on the heap and read the data from a file. ;  One of the reasons why I have the data in this form, is that it''s easy to edit and maintain.Putting the data into separate file would be a bit harder to edit, also, I want to keepthe data from being accidently lost if files are moved around.  Maybe adding it as a resourceto the exectuable could help, but still that would mean I have to put it in a data file.But I never thought about putting it into a DLL and loading/unloading it.  That would mean I could still keep it in a global initialization array form.  Thanks. 