Please check following code tell me what the difference between Convert.ToInt32()
and int()
, Why Convert.ToInt32
is showing error?
Here UserType
is a enum
// Showing error constant initializer must be compile time constant
const int case1 = Convert.ToInt32(UserType.Admin);
const int case2 = int(UserType.Admin);