Answers:
// here normal pointer
P* ptr = new P; // usual pointer allocated on heap
P& nat = *ptr; // object on heap bind to native object
//.. here CLI managed
MO^ mngd = gcnew MO; // allocate on CLI heap
MO% rr = *mngd; // object on CLI heap reference to gc-lvalue
在一般情况下,加标点%是^因为加标点&是*。在C ++中,一元运算&符在C ++ / CLI中是一元运算%符。
当&ptr产生a时P*,%mngd产生MO^。
从MSDN看来,插入符号意味着您正在处理要创建的类型。
在C ++ / CLI中,它表示托管指针。您可以在这里阅读有关它的更多信息(以及其他C ++ / CLI功能):