Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

User-Defined Conversions Sample

This sample shows how to define conversions to or from classes or structures, and how such conversions are used.

This sample contains the source code for the User-Defined Conversions Tutorial.

Building and Running the Sample Within Visual Studio

To build and run the User-Defined Conversions samples

  1. Open the solution (UserConversions.sln).
  2. In Solution Explorer, right-click the Conversion1 project and click Set as StartUp Project.
  3. From the Debug menu, click Start Without Debugging.
  4. Repeat the preceding steps for Conversion2.

Building and Running the Sample from the Command Line

To build and run the User-Defined Conversions samples

  1. Use the Change Directory command to change to the Conversion1 directory.
  2. Type the following:
    csc conversion.cs
    conversion
    
  3. Use the Change Directory command to change to the Conversion2 directory.
  4. Type the following:
    csc structconversion.cs
    structconversion
    

See Also

User-Defined Conversions Tutorial | Tutorial Samples

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.