2013-02-25 6 views
-6

다음 코드에서 혼란 스럽 습니다만, 여기서는 사용하지 않는 것 같습니다.이 C# 코드는 어떻게 작동합니까? (aspx.cs 클래스에서)

public bool GetFormsCredentials(out Cookie authCookie, out string userName, out string password, out string authority) { 
     authCookie = null; 
     userName = password = authority = null; 
     return false; 
    } 

코드 exacutes 위, 그래서 값이 할당

C# 지정 작업에
userName = myName 
password = 12345 
authority = someAuthority 
+6

이것은 기본적 것'null' 모든 매개 변수 – Zbigniew

+0

가능한 중복 http://stackoverflow.com/questions/1419252/c-assign-same-value-to-multiple-variables-in-single-statement –

+0

@walkhard - 알겠습니다. – Coffee

답변

1

"="반환 다음과 같이

userName = (password = (authority = null)); 

또는

authority = null; 
password = authority; 
userName = password; 
+0

쿨, 고마워. – Coffee

관련 문제