|
-
February 21st, 2006, 06:27 PM
#1
A question regarding String*
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.
-
February 22nd, 2006, 03:53 AM
#2
Re: A question regarding String*
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();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|