다중 값 반환 (Return multiple value to a method)
c# 7 Version 부터 포함된 문법으로 Tuple 형태로 반환이 가능하다.
반응형
사용하는 방식은 다음과 같다.
public (bool,bool,bool) GetResultStageStar()
{
bool starFlag1 = false;
bool starFlag2 = false;
bool starFlag3 = false;
return (starFlag1, starFlag2, starFlag3);
}
Miscrosoft C# 7 version : [ 링크 ]
What's New in C# 7.0
Update (4/2017): See New Features in C# 7.0, the update to this post. What follows is a description of all the planned language features in C# 7.0. With the release of Visual Studio “15” Preview 4, most of these features are coming alive.
devblogs.microsoft.com
★☆☆☆☆
반응형
'개발 > 기본) 기본기' 카테고리의 다른 글
기본기) Custom Exception (사용자 정의 예외) (0) | 2022.07.04 |
---|---|
기본기) Null을 효과적으로 처리하기 위한 팁 (0) | 2022.05.31 |
기본기) c#) 연속된 숫자를 문자 String 만들기 (0) | 2022.04.05 |
기본기)c#) 자동으로 구현된 속성 (0) | 2022.02.11 |
기본기)의사코드(Pseudo Code ) (0) | 2022.01.13 |
댓글