Mr. Utas is on the right track. You have it pretty close but it needs a few changes. Here is one way :
void get_input( char * input )
{
printf( "Enter a string to find its length: " );
scanf( "%s", input );
}
int main( void )
{
int str_length = 0;
char user_in[ 50 ] = { 0 }
get_input( user_in );
str_length = length_input( user_in );
printf( "Length of input: '%s' is: %d\n" , user_in , str_length );
}
Your length function looks
OK. has a problem : it should initialize length to zero.