© Robert E. Beasley 2020
R. E. BeasleyEssential ASP.NET Web Forms Developmenthttps://doi.org/10.1007/978-1-4842-5784-5_7

7. Conversion Operations

Robert E. Beasley1 
(1)
Franklin, IN, USA
 

7.1 Introduction

A conversion operation alters the value in a variable of one type so that it can be used in a variable of another type. Conversions can be widening or narrowing. A widening conversion always preserves the value of the source variable since the target variable can fully accommodate the range of possible values of the source variable. Thus, this type of conversion always succeeds during program execution because it cannot result in the loss of data. A narrowing conversion, on the other hand, may not preserve the value of the source variable since the ...

Get Essential ASP.NET Web Forms Development: Full Stack Programming with C#, SQL, Ajax, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.