In the first case, the runtime does the conversion for you. In the second
case, the compiler does the conversion. Where possible, if left to me, I'll
let the compiler do these kind of basic type conversions - because it's done
once during compile phase and makes my code snappier.
-vJ
"Paul Hetherington" <pN*****************@vNiOsSuPaAlMstatement.com> wrote in
message news:ev**************@TK2MSFTNGP09.phx.gbl...
Hi,
Which is the more recomended way to do type conversion in C# for basic
data types(integer, singles, doubles etc...)
System.Convert.ToSingle,ToInt32 etc...?
or (float)myvar; (int)myvar, etc..?
TIA
--
Paul