static unsigned int leading_digit(const unsigned int number)
//buffer to store the number as a string
//convert the number to a string a store it in the buffer
sprintf(buffer, "%u", number);
//return the leading digit as a number by converting the value of the first character to a unsigned integer
return ((unsigned int)buffer - (unsigned int)'0');
I will answer any c language programming and syntax questions.
I have almost a decade of c programming experience.
I have a bachelor of science degree and several years of industry experience.