我記得在某處看到「^」運算符被用作託管C++代碼中的指針運算符。因此「^」應該等價於「*」操作符?瞭解String^in C++ .Net
假設我的理解是正確的,當我開始理解.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
我無法理解這一點。