강의

멘토링

커뮤니티

Inflearn Community Q&A

baikingtv's profile image
baikingtv

asked

C# Beginner to Xamarin Forms + Maui Android, Windows App (UWP) Development

Ch_18_Class method static method reference type out type

18강에서 ref가 이해가 되지 않습니다

Written on

·

276

0

18강에서

Ch_17 ch_17 = new Ch_17()
Ch_18.time3(ref ch_17)

클래스:

public static void time3(ref Ch_17 ch_17)
{
    ch_17.name = "태권브이"
    Console.WriteLine(ch_17.name + "고향:" + Ch_17.homeTown)
}

이 나옵니다. 근데 이미 클래스에서 ch_17을 참조 (ref Ch_17 ch_17)한다고 나와있는데 왜 클래스를 이용할 때 ref ch_17를 붙여야 하나요?

 

  • 강의를 한 번 더 보니 이해가 되었습니다. ref Ch_17 ch_17은 매개변수 내의 클래스이고 ref ch_17을 해서 ref Ch_17 ch_17 내에 ch_17 클래스를 넣는 것이군요!

C#GUIXamarin

Answer

This question is waiting for answers
Be the first to answer!
baikingtv's profile image
baikingtv

asked

Ask a question