I'm coding in VC++.net (managed C++). Is there a way to create dynamic arrays and preserving the data when the dimensions are changed? I know that Visual Basic can do this.

In VB:
ReDim Preserve mLn(UBound(mLn) + 1)

In C you would use realloc(). In C++ you have to emulate it. Allocate the new area, copy the old stuff to the new area, and free the old area.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.