Chapter 2 Quick Reference


To

Do this

Create a class.

Use the keyword class.

Control the visibility of variables and methods.

Use the access control keywords public, private, or protected, followed by a colon(:).

Declare a reference type class.

Place the __gc keyword before the class specifier.

Declare a value type class.

Place the __value keyword before the class specifier.

Instantiate a reference type class object.

Declare a pointer of the class type for the object. Use the new keyword followed by the name of the class to create the object on the CLR heap, and assign the returned pointer to the object pointer declared above. For example:
HeapClass *pObject1:
pObject1 = new HeapClass;

Instantiate a value type class object.

Define the object by stating its class followed by the variable name for the object. For example:
ValueClass object1;




Microsoft Visual C++  .NET(c) Step by Step
Microsoft Visual C++ .NET(c) Step by Step
ISBN: 735615675
EAN: N/A
Year: 2003
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net