How do I REset a managed array????

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?
 
0

0to60

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?
 
E

Edward Diener

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top