-
C#에서 ref 키워드를 사용하면 주소값으로 접근할 수 있다 소스를 살펴보자 int num = 10; int num1 = num; ref int num2 = ref num; // managed pointer num2 = 20; WriteLine($@" num:{num}, num1:{num1}, num2:{num2} "); num2에 num의 주소값을 넣어주었기 때문에 num2를 변경하면 num까지 같이 변경된다