Długość int lub dziesiętna

#include<cmath>
    ...
    int size = trunc(log10(num)) + 1
....
Glamorous Goose