* instead of ^?

Posted on 2006-03-28
Medium Priority
Last Modified: 2010-04-24
Can I use * instead of ^ when I write managed code for .NET 1.1 and VC.Net 2003.

System::Net::IPAddress* localAddress_;

does not give me an error as long as I create my class as a __gc class.

System::Net::IPAddress^ localAddress_;

Won't work - though I'd prefer to use the second one with ^ instead of *.
Question by:bjqrn
1 Comment
LVL 48

Accepted Solution

AlexFM earned 2000 total points
ID: 16310667
In C++ 7.0 (2003) you must use * both for managed and unmanaged classes.
In C++ 8.0 (2005) you need to use ^ for managed classes and * for unmanaged classes.

__gc is C++ 7.1 keyword. In C++ 8.0 it is replaced with ref and value keywords, managed instances are allcated with gcnew instead of new.

7.1    __gc        *   new
8.0   ref value   ^   gcnew

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question