CLR class correspondant to std::vector<> or CArray<>?

H

Hyun-jik Bae

What is the CLR class correspondant to std::vector<> or CArray<>?
I looked for how to resize object[] (aka array<object> in C++/CLI), but I
cannot find it yet.
Please reply. Thanks in advance.

Hyun-jik Bae
 
K

Kevin Spencer

The equivalent of an MFC Template is a Generic class. There is no equivalent
for std::vector<>, as arrays are declared by their individual types:

string[] strings = new string[1];
System.Data.DataTable[] tables;

There are generic static methods in the System.Array class that can be used
on arrays of any type, however.

As for the CArray<> Template, I would think that the equivalent would be
System.Collections.ObjectModel.Collection<T>. This is a generic Collection
which has basically the same functionality.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.
 

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