May 2010
Intermediate to advanced
1272 pages
61h 18m
English
CTypeThe CType operator also can be overloaded to provide appropriate mechanisms for converting to and from a custom type. The interesting thing in overloading CType is that you have to consider both situations studied in Chapter 4, known as widening and narrowing conversions (see that topic for further details). Continuing the previous example of the ThreePoint structure, the following code snippet offers a special implementation of CType enabling conversions to and from an array of integers:

The code is quite simple. Notice how you must specify a keyword corresponding to the effective kind of conversion (Widening and Narrowing
Read now
Unlock full access