cfyam <cf***@mail.apol.com.tw.NOSPAN> wrote:
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.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too