Array initialization in Managed C++

前端 未结 2 1248
再見小時候
再見小時候 2021-01-12 09:14

I wish to declare and initialize a 1D managed array of items.

If it was C# code, I would write it like this:

VdbMethodInfo[] methods = new VdbMethodI         


        
相关标签:
2条回答
  • 2021-01-12 09:53

    The C++/CLI array declare & initialize syntax is not dissimilar from that in C#. Here's an example...

    array<String^>^ myArray = gcnew array<String^> {"first",  "second"};
    
    0 讨论(0)
  • 2021-01-12 09:59

    MSDN page on managed array syntax: http://msdn.microsoft.com/en-us/library/ts4c4dw6(VS.80).aspx

    0 讨论(0)
提交回复
热议问题