개발/기본) 기본기
기본기)c#) 다중 값 반환 (Return multiple value to a method)
테샤르
2022. 4. 6. 18:37
다중 값 반환 (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
★☆☆☆☆
반응형