I\'m trying to find a way to find the length of an integer (number of digits) and then place it in an integer array. The assignment also calls for doing this without the use
How about (works also for 0 and negatives):
int digits( int x ) { return ( (bool) x * (int) log10( abs( x ) ) + 1 ); }