find total number of digits in cpp code example
Example: count digits c++
template <class T>
T countDigits(T number)
{
return T(log10(number) + 1);
}
//If the number is very large, use string
template <class T>
T countDigits(T number)
{
return T(log10(number) + 1);
}
//If the number is very large, use string