teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

質問文修正

2017/07/25 14:53

投稿

inori
inori

スコア14

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
1
1
  # C#のDictionaryのキーに配列を用いたい
2
- 辞書のキーにint[]を、値にstringを用いたいと考えていますが、存在と判定されています。
2
+ 辞書のキーにint[]を、値にstringを用いたいと考えていますが、存在しないと判定されています。
3
3
  以下にコードを記述します、お力添え頂けると幸いです。
4
4
 
5
5
  > Dictionary<int[], string> DICTIONARY = new Dictionary<int[], string>();

2

変数直しました

2017/07/25 14:53

投稿

inori
inori

スコア14

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
1
1
  # C#のDictionaryのキーに配列を用いたい
2
- 辞書のキーにint[]を、値にintを用いたいと考えていますが、存在と判定されています。
2
+ 辞書のキーにint[]を、値にstringを用いたいと考えていますが、存在と判定されています。
3
3
  以下にコードを記述します、お力添え頂けると幸いです。
4
4
 
5
5
  > Dictionary<int[], string> DICTIONARY = new Dictionary<int[], string>();

1

変数名直しました

2017/07/25 14:50

投稿

inori
inori

スコア14

title CHANGED
File without changes
body CHANGED
@@ -6,10 +6,10 @@
6
6
  > DICTIONARY.Add(new int[] {0,1 }, "test");
7
7
 
8
8
  > int[] KEY = new int[] {0,1};
9
- > bool HasKey = dic.ContainsKey(KEY);
9
+ > bool HasKey = DICTIONARY .ContainsKey(KEY);
10
10
  > if (HasKey)
11
11
  > {
12
- > return dic[KEY];
12
+ > return DICTIONARY [KEY];
13
13
  > }
14
14
 
15
15
  よろしくお願いします!