我记得在某处看到“^”运算符在托管 C++ 代码中用作指针运算符。因此“^”应该等同于“*”运算符对吗?
假设我的理解是正确的,当我开始理解 .Net 并编写了一些示例程序时,我遇到了一些这样的代码:
String ^username; //my understanding is you are creating a pointer to string obj
.
. // there is no malloc or new that allocates memory to username pointer
.
username = "XYZ"; // shouldn't you be doing a malloc first??? isn't it null pointer
我很难理解这一点。