Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- react ts
- javascript
- vscode extension
- asp.net core mvc
- React Redux
- 리액트 리덕스
- Docker
- asp core mvc
- 리덕스
- react typescript
- 도커 레이어
- 리액트 타입스크립트
- redux
- asp core 권한
- docker container
- 도커
- asp.net core
- 리액트
- C#
- 도커 컨테이너
- docker layer
- c# delegate
- 리액트 타입스크립트 적용하기
- js
- Asp Net Core
- Docker image
- 도커 이미지
- ASP Core
- Git
- react
Archives
- Today
- Total
기초 메모지
C# - 삼항 연산자(Ternary Operator) 본문
삼항 연산자 형식은 다음과 같습니다.
(조건 식 ? True에 실행할 코드 : False에 실행할 코드)
삼항 연산자와 일반 조건문을 비교했을때 더 간결한 표현이 가능합니다.
int x = 1;
Console.WriteLine(x == 1 ? "참(True)" : "거짓(False)");
int x = 1;
if (x == 1)
{
Console.WriteLine("참(True)");
}
else
{
Console.WriteLine("거짓(False)");
}
반응형
'Languages > C#' 카테고리의 다른 글
C# - 큐(Queue) (0) | 2022.07.10 |
---|---|
C# - 스택(Stack) (0) | 2022.07.10 |
C# - 유효 범위(Scope) (0) | 2022.07.07 |
C# - 상수(Constant), 변수(Variable) (0) | 2022.07.07 |
C# - 분할 클래스(Partial Class) (0) | 2022.07.05 |
Comments