Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 13 Conversions Paragraph 11 A conversion enables an expression of one type to be treated as another type. 2 Conversions can be implicit or explicit, and this determines whether an explicit cast is required. [Example: For instance, the conversion from type int to type long is implicit, so expressions of type int can implicitly be treated as type long. The opposite conversion, from type long to type int, is explicit and so an explicit cast is required.
int a = 123;  
long b = a;     // implicit conversion from int to long  
int c = (int) b;  // explicit conversion from long to int  
end example]
3 Some conversions are defined by the language. 4 Programs may also define their own conversions (§13.4).
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS