I am using this answer to this question in order to view the 0's in my binary value Byte to Binary String C# - Display all 8 digits
int a = 00010
and am converting it into a string with:
string b = Convert.ToString(a).PadLeft(5, '0');
This works perfectly and I can print 00010 instead of 10. However, I need to convert this back to an integer in order to populate an integer array. I am using this to convert it back into a integer:
int c = Convert.ToInt32(b);
Console.WriteLine(c);
Howwever, when I print this it the preceding 0's are missing, and I am printing '10'. Is there any way to convert this back to an integer and keep the preceding 0's? Thanks.