views:

83

answers:

2

What are main difrences between * ^ and & in visual-C++ 2010?

+1  A: 
Alex Farber
Ben Voigt
+2  A: 

You mean C++/CLI, the new "managed C++" designed by Microsoft.

  • Type* still declares a native pointer
  • Type^ declares a reference to an object allocated with gcnew (you can think of it as a "pointer on managed objects")
  • Type& still declares a native reference
Samuel_xL
`Type^` is not a reference but a tracking handle. `Type%` is a tracking (gc-aware) reference to a managed type.
Ben Voigt