CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2000
    Posts
    1,471

    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.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    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
  •  





Click Here to Expand Forum to Full Width

Featured