일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- dart 언어
- Flutter
- Python
- jupyter lab
- 플러터
- HTML
- C언어 포인터
- c언어
- github
- 깃
- c# 추상 클래스
- jupyter
- vim
- 구조체
- Unity
- gitlab
- 유니티
- 포인터
- git
- C# delegate
- 도커
- 다트 언어
- c# winform
- Data Structure
- Algorithm
- Houdini
- c#
- C++
- docker
- c# 윈폼
Archives
- Today
- Total
목록c# try catch (1)
nomad-programmer
[Programming/C#] 예외 처리
예외는 throw 문을 이용하여 던진다. 그래서 던진 예외를 try~catch로 받는다. throw 는 보통 문(statement)으로 사용하지만 C#7.0부터는 식(expression)으로도 사용할 수 있도록 개선되었다. int? foo = null; // foo는 null이므로 bar에 foo를 할당하지 않고 throw 식이 실행된다. int bar = foo ?? throw new ArgumentNullException(); // 조건 연산자 안에서도 사용할 수 있다. int[] array = new int[] {1, 2, 3}; int index = 4; // 삼항 연산자를 이용한 예외 던지기 int value = array[ index >= 0 && index < 3 ? index : throw..
Programming/C#
2020. 9. 21. 19:14