Array of dictionaries in C#

后端 未结 5 1795
挽巷
挽巷 2020-12-15 05:42

I would like to use something like this:

Dictionary[] matrix = new Dictionary[2];

But, when I do:

5条回答
  •  孤街浪徒
    2020-12-15 05:58

    You forgot to initialize the Dictionary. Just put the line below before adding the item:

    matrix[0] = new Dictionary();
    

提交回复
热议问题