C# Dictionary
2015.08.28 13:53
배열 대신 사전.
using System;
using System.Collections.Generic;namespace Dictionary_array_alt
{
class Program
{
static void Main(string[] args)
{
// 인덱스는 스트링, 데이터는 배열
var var1_dic = new Dictionary<string, string[]>();var1_dic.Add("idx1", new string[] { "1st string", "2nd string" });
var1_dic.Add("idx2", new string[] { "3rd string", "4th string" });foreach (KeyValuePair<string, string[]> each_value in var1_dic)
{
Console.Write("Array: "+each_value);
Console.Write("\r\n");
Console.Write(" / Index: " + each_value.Key);
Console.Write(" / Value: " + each_value.Value[0]);
Console.Write(" / Value: " + each_value.Value[1]);
Console.Write("\r\n");
}Console.WriteLine("Press Enter key to close.");
Console.ReadLine(); // Pause
}
}
}
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 툴 북마크 | 꿈돌이 | 2021.02.11 | 80955 |
58 | 디렉터리 안에 신규 파일 생성여부 확인 | 꿈돌이 | 2016.04.26 | 1939 |
57 | dlib bearid 메모 | 꿈돌이 | 2020.02.03 | 1840 |
56 | dlib dnn_metric_learning_on_images_ex.cpp | 꿈돌이 | 2020.02.07 | 1404 |
55 | 3d 모델 사이트 | 꿈돌이 | 2020.03.02 | 1295 |
54 | 12864 결선 - OLED 0.96 결선 확인용 | 꿈돌이 | 2020.01.27 | 1256 |
53 | 안드로이드 루팅없이 특정 어플 실행 막기 | 꿈돌이 | 2015.06.28 | 1209 |
52 | svm_c_ex.cpp | 꿈돌이 | 2020.02.16 | 1203 |
51 | xe 업로드 된 파일이 첨부목록에서 사라질 경우 | 꿈돌이 | 2015.03.30 | 1185 |
50 | 안드로이드 스마트폰으로 웹서버 만들기 | 꿈돌이 | 2018.01.04 | 1159 |
49 | 리눅스에서 php -r | 꿈돌이 | 2018.07.25 | 1024 |
48 | php-mailer 메일 전송 안 될 경우 | 꿈돌이 | 2015.03.28 | 984 |
47 | System unique id 추출 | 꿈돌이 | 2016.06.23 | 799 |
46 | Git .gitignore | 꿈돌이 | 2017.03.18 | 781 |
45 | 라즈베리파이 USB메모리 자동 마운트 | 꿈돌이 | 2018.10.30 | 699 |
44 | ms sql-server 명령 몇개 | 꿈돌이 | 2019.11.25 | 622 |
» | C# Dictionary | 꿈돌이 | 2015.08.28 | 553 |
42 | 프리캐드 사용법 | 꿈돌이 | 2020.10.14 | 551 |
41 | 윈도우8.1 프리징 해결 방법 | 꿈돌이 | 2015.04.07 | 534 |
40 | C 문자열 처리를 위한 다차원 배열 | 꿈돌이 | 2015.03.02 | 495 |
39 | 리눅스 sh에서 실행파일 삭제 | 꿈돌이 | 2019.06.10 | 485 |