FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
September 01, 2005

C++/CLI: Cloning

(Page 4 of 11)

September, 2005: C++/CLI: Cloning

Listing 2

public ref class Point : ICloneable
{
     // ...
public:
     virtual Object^ Clone()
     {
          return MemberwiseClone();
     }
};
int main()
{
/*1*/     Point^ p1 = gcnew Point(3, 5);
/*2*/     Console::WriteLine("p1: {0}", p1);
/*3*/     Point^ p2 = static_cast<Point^>(p1->Clone());
/*4*/     p1->Move(9, 11);
/*5*/     Console::WriteLine("p1: {0}", p1);
/*6*/     Console::WriteLine("p2: {0}", p2);
}

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK