title: Two dimensional dictionary in CLI/C++
body: <p>I am trying to store data in a two dimensional dictionary with the programming language CLI/C++.</p>
  
  <p>However, I am facing problems adding something into them.</p>
  
  <p>This is my attempt which works in C#:</p>
  
  <pre><code> Dictionary&lt;int, Dictionary&lt;int, string&gt;&gt; MyDictionary;
   if (!MyDictionary.ContainsKey(100))
      MyDictionary.Add(100, new Dictionary&lt;int, string&gt;());
  
   MyDictionary[100][1234] = "Hello World";
  </code></pre>
  
  <p>Now - my CLI/C++ attempt:</p>
  
  <pre><code>Dictionary&lt;int, Dictionary&lt;int, String^&gt;^&gt;^ MyDictionary = gcnew Dictionary&lt;int, Dictionary&lt;int, String^&gt;^&gt;();
  //ContainsKey check here
  MyDictionary[100][1234] = "Hello World"; //&lt;--- ERROR
  MyDictionary[100, 1234] = "Hello World"; //&lt;--- ERROR
  </code></pre>
  
  <p>It seems that you don't add something into the Dictionary using [][]. I saw people using [100, 1234] instead of [100][1234] but that doesn't work either.</p>
  
  <p>Error:</p>
  
  <pre><code> function "System::Collections::Generic::Dictionary&lt;TKey, TValue&gt;::default[TKey]::set [with TKey=int, TValue=System::Collections::Generic::Dictionary&lt;int, String ^&gt; ^]" cannot be called with the given argument list
          argument types are: (int, int, String^)
          object type is: System::Collections::Generic::Dictionary&lt;int, System::Collections::Generic::Dictionary&lt;int, String ^&gt; ^&gt; ^ 
  </code></pre>
  
  <p>What am I doing wrong?</p>