2009-12-17 4 views

답변

2

그때 정적 생성자에서 배열의 내용으로 사전을 초기화 배열 초기화를 인라인으로 생성 된 해낸 가장.

static initonly System::Collections::Generic::Dictionary<System::String^, System::String^>^ dictionary; 
static initonly array<System::String^> arrayToPopulateDictionary = gcnew array<System::String^> { "foo", "bar" }; 

static Foo() 
{ 
    for (int i = 0; i < arrayToPopulateDictionary->Length; i += 2) 
     listMappings->Add(arrayToPopulateDictionary[i], arrayToPopulateDictionary[i + 1])); 
} 
같은 뭔가
0

을 다음 C# 예제 같은 것을하고 싶어.

0

확실히 그 C++/CLI로 변환 여부 (가해야 할)를 알 수 있는지, C++0x 가능 될 것입니다.