Why Convert.ToInt32(null) returns 0 in c#

Viewed 71447

I just came across this today, if you convert null to int32

Convert.ToInt32(null)

it returns 0

I was expecting an InvalidCastException...

Any idea why this happen?

6 Answers
Related