How do I REset a managed array????

  • Thread starter Thread starter 0to60
  • Start date Start date
0

0to60

I can declare and initialize a managed array of managed types like this:

System::Object* array __gc[] = {...}



Now, what do I do if I wanna reset that array to something else without
redeclaring it? I can't seem to just say something like

array = new __gc[] = {...}

or

array = {...}



How do I do this?
 
Bruno van Dooren said:
i think it is

array->Clear();

Well, that will clear it out, but how do I set it to some new set of data,
of possibly different length?
 
0to60 said:
Well, that will clear it out, but how do I set it to some new set of
data, of possibly different length?

array = new System::Object *[n]; // where n = the new length

I don't think you can allocate in this way using an initialiser list.
 
Back
Top