VC++ Redim Preserve as in VB??

Started by
1 comment, last by HellRiZZer 22 years, 7 months ago
Is there any function in VC++/C++ that does the same thing as Redim Preserve in VB?? Say, in VB I have aa[5] as integer; I set all aa[0 to 5] data, the when I want to expand it to required size, I call Redeim Preserve aa[0 to 20] as integer; and all my data from 0 to 5 is at the same place.. Is there any such function for VC++? I know, its easy to implement such function, but is there already existing one? " Do we need us? "

Warrior of Great Darkness

Advertisement

Take a look here for array info:
http://www.chips.navy.mil/archives/99_apr/c++arrays.htm


My Girlfriend , "Dull! I''m not dull! How could you say that"
Me , "I didn''t say dull, I said null"
My Girlfriend "Oh Okay..."
Use that page for the redimming bit. To emulate the Preserve keyword, you need to create a new array of the correct size and then transfer the stuff from the old array to the new one. This is what happens when VB does it which is why Redim Preserve is slower than Redim.

Trying is the first step towards failure.
Trying is the first step towards failure.

This topic is closed to new replies.

Advertisement