I was recently making a program which needed to check the number of digits in a number inputted by the user. As a result I made the following code:
int x;
If x is an integer, and by "built in function" you aren't excluding logarithms, then you could do
x
double doub_x=double(x); double digits=log(abs(doub_x))/log(10.0); int digits= int(num_digits);