본문 바로가기

C#/공부기록

[C#] List<T>

 

ㆍList<T>

- 동적 크기조절 가능한 배열

사용법

using System.Collections.Generic;

List<int> list = new List<int>();

<예제>

using System.Collections.Generic;
 
class Program
{
    static void Main()
    {
        List<int> list = new List<int>();
 
        list.Add(1);
        list.Add(2);
        list.Add(3);
        list.Add(4);
    }
}
 

 

'C# > 공부기록' 카테고리의 다른 글

[C#] 람다식, Func, Action  (0) 2023.01.14
[C#] Linq  (0) 2023.01.14
[C#] 어셈블리(assembly)  (0) 2023.01.14
[C#]이벤트(event)  (0) 2023.01.14
[C#] 대리자(delegate), 이벤트(event)  (0) 2023.01.14