Please Help! Dynamic Allocation of array of structures

  • Thread starter Thread starter RBCC
  • Start date Start date
R

RBCC

Does anyone know how to dynamically allocate array of structures? Or where
Ican find info on this on the web? John
 
Does anyone know how to dynamically allocate array of structures? Or where
Ican find info on this on the web? John


Oh, or better yet - if possible - change your structures to classes and
use an ArrayList...
 
* RBCC said:
Does anyone know how to dynamically allocate array of structures? Or where
Ican find info on this on the web? John

'ReDim Preserve'...
 
why classes? when a struct will do

jc

Tom Shelton said:
Oh, or better yet - if possible - change your structures to classes and
use an ArrayList...
 
Jose,
Because structs will be boxed when you put them into an ArrayList, making it
slightly more difficult to update them.

Classes will not be boxed when they are put into the ArrayList as they are
already reference types, so they are easier to work within an ArrayList.

Remember that an ArrayList is designed to hold Objects (reference types).

Hope this helps
Jay
 

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

Back
Top