Type Conversions

Converting information from one data type to another is a fairly common programming task.For example, you might retrieve text input for a user that contains numbers you want to use for a calculation.Or, you might need to take a calculated value and transform it into text you can display in a web page.
Conversion are two types: widening and narrowing.Widening conversion are always succeed.For example, you can convert a 32-bit integer into a 64-integer. You wont need any special code.

Here is an example:

int vMySmallValue;
long vMyLargeValue;
vMySmallValue=Int32.MaxValue;
vMyLargeValue=vMySmallValue;

No comments:

Post a Comment