[問題] this pointer; l-value
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
問題(Question):
我想把這個物件直接指向別的位址
所以我寫
void AssignAddress(Myclass<T> &A)
{
this = &A;
}
錯誤結果(Wrong Output):
complier說this不能是左值
為什麼不能是左值?
我要怎麼樣修改呢@@?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.96.91.150
→
07/26 11:40, , 1F
07/26 11:40, 1F
→
07/26 11:41, , 2F
07/26 11:41, 2F
→
07/26 11:41, , 3F
07/26 11:41, 3F
→
07/26 12:44, , 4F
07/26 12:44, 4F
→
07/26 12:59, , 5F
07/26 12:59, 5F
→
07/26 13:00, , 6F
07/26 13:00, 6F
→
07/26 13:00, , 7F
07/26 13:00, 7F