I need to make a 40 digit counter variable. It should begin as 0000000000000000000000000000000000000001 and increment to 000000000000000000000000000
0000000000000000000000000000000000000001
000000000000000000000000000
Try using
int myNumber = ...; string output = myNumber.ToString("D40");
Of course, the int can never grow so huge as to fill out all those digit places (the greatest int having only 10 digits).
int