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
2010-01-09 14:19:27
+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
2010-01-09 14:27:57