class clTest
{
      public string student;
 }

 


 clTest _clTestA = new clTest();
 clTest _clTestB = new clTest();


 _clTestB.student = "B";

 _clTestA = _clTestB;  <-------- (1)


 _clTestB.student = "BB";  <--- 여기 바꾸면  (1) 의 _clTestA.student 도 "BB"가 된다.

 

 

클래스간의 대입은 같은 포인터주소가 되는것 같다.

그래서

 

clTest _clTestA = new clTest();
 clTest _clTestB = new clTest();


 _clTestB.student = "B";

 _clTestA = _clTestB; 

 

 _clTestB = new clTest();   <---------재 할당하여 사용하였다.
_clTestB.student = "BB"; 

 

'c샵' 카테고리의 다른 글

C# linkLabel 사용시 에러 뜰때  (0) 2017.04.21
C# htmlagilitypack 으로 from접근  (0) 2017.04.19
# 실행이 갑자기 꼬이고 디버그 debug 가 안걸릴때 ,,  (0) 2017.04.16
C# tabControl  (0) 2017.04.16
c# HashTable  (0) 2017.04.16

+ Recent posts