dullboy
February 21st, 2006, 05:27 PM
For example, I define String* str. Is str a string or a pointer to a string? I am a C++ programmer and new to C++.net. I am always confused by that. Could any guru here explain a little bit? Thanks for your inputs.
Alex F
February 22nd, 2006, 02:53 AM
This is managed pointer, or reference, to managed .NET String object. The difference from plain C++ pointer and is that it has reference counter and released automatically by Garbage Collector when reference counter is 0. You don't need to release it.
In VC++ 8.0 managed reference is defined using ^ sign, this looks better:
String^ str = gcnew String();