tags:

views:

105

answers:

3

Hey. I'm trying to get this code http://www.codeguru.com/Cpp/W-P/files/inifiles/article.php/c4455/#more to compile under a CLR WinForms app I'm making. But what is the right syntax? A CString under CLR is to be written System::String but what about CStringList? (I figure it's a string array)

A: 

You should use one of the types from System.Collections.Generic, for example System.Collections.Generic.List

There is a simple example at the bottom of that page.

GregS
+2  A: 

What do you mean by CLR equivalent?

If you mean plain C# then this will do:

string[] arr = new string[size];

or:

List<String> list = new List<String>();

If you mean C++/CLI by CLR equivalent then something like this should work:

array<String^>^ arr = gcnew array<String^>(size);

or:

List<String^>^ list = gcnew List<String^>^();
Idan K
A: 

StringCollection for instance, or

List<String>
Frederik Gheysels