Wednesday, January 9, 2013

C# .net Convert bool to int

bool theBool = true;
int boolToInt = theBool ? 1 : 0; //1 if theBool is true and 0 if theBool is false
that's it.