[C#] Null 조건 연산자
·
Game Programming/C#
Null 검사Null 체크는 프로그래밍에서 매우 중요한 작업으로, 매우 빈번하게 사용됩니다. 다음 예시를 보면class Test{ public string name = null;}internal class Program{ static void Main(string[] args) { Test test = new Test(); PrintName(test); } static void PrintName(Test test) { Console.WriteLine(test.name); }}PrintName() 함수에서 test의 name을 출력하는 부분이 있습니다.현재 test 객체의 name은 null값을 가지고 있으며, 접근하게 된다면 Nu..