Tuesday, July 28, 2009

Take the Address of a Managed Pointer?

In C++/CLI, how does One take the address of a managed pointer (e.g., an int ^)?

Take the Address of a Managed Pointer?
Their is a managed address of operator, just like their is a managed pointer operator, it is %. Note that you have to use pin_ptr usually to fix the memory address of the object in question, otherwise the garbage collector can move it and your program will perform illegal operations. The pin_ptr statement is similar to the fixed keyword in C#.

survey software

No comments:

Post a Comment