일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- wpf
- length
- Android
- Encapusulation
- sensor
- c++
- public
- aduino
- digitalRead
- Unity
- Pointer
- atmega328
- java
- flutter
- Read
- Contour
- preprocessing
- mfc
- UNO
- parameter
- memory
- APP
- Class
- compare
- stream
- file access
- inheritance
- Overloading
- Barcode
- SERIAL
Archives
- Today
- Total
폴크(FOLC)
C# - 데이터 초기화 방법 본문
728x90
반응형
int x = 0;
bool b = false;
string s = null;
MyClass obj = null
int[] arr = null; // null (배열은 참조형)
int[] numbers = new int[5]; // {0, 0, 0, 0, 0}
byte[] arr = null; // null (배열은 참조형)
byte[] numbers = new byte[0];
byte[] numbers = Array.Empty<byte>();
float[] arr = null; // null (배열은 참조형)
float [] numbers = new float[0];
float [] numbers = Array.Empty< float>();
string[] names = new string[3]; // {null, null, null}
string[] fruits = { "apple", "banana", "cherry" };
int[,] grid = new int[2, 3]; // 2행 3열, 기본값은 0
int[,] matrix = { { 1, 2 }, { 3, 4 } };
List<int> list = new List<int> { 1, 2, 3 };
int[] arr = list.ToArray();
728x90
반응형
사업자 정보 표시
사업자 등록번호 : -- | TEL : --
'C#, WF, WPF(.NET)' 카테고리의 다른 글
.NET 6 (0) | 2022.01.22 |
---|