Declare an array of object references in VC++.net

上了贼船, 只能当贼.
Following the weird syntax of VC++.net, here is how to declare an array of a dotnet object references.

static array<System::Threading::Mutex^>^ trackers_mut = gcnew array<System::Threading::Mutex^>(10);

or

array <String^>^ filenames={"aa", "bb"};

有点抓狂. 但的确是这么写的. C及其衍生物总是那么变化无穷.

No comments yet. Be the first.