I fear there\'s a simple and obvious answer to this question. I need to determine how many digits wide a count of items is, so that I can pad each item number with the m
Okay, I can't resist: use /=:
/=
#include int main(){ int num = 423; int count = 1; while( num /= 10) count ++; printf("Count: %d\n", count); return 0; } 534 $ gcc count.c && ./a.out Count: 3 535 $