type case

  • Thread starter Thread starter cfyam
  • Start date Start date
cfyam said:
What's the difference between the "Convert.Int32(XXX)" and "(int)XXX"?

Convert.ToInt32 can take various types, including string, in which case
it parses the string. It will also always detect overflows. Casting
only works if the "source" type has an explicit or implicit conversion
operator to int.

Casting will generally be faster where it's available.
 
Back
Top