>>but it does not work properly when I check the string length
Just add code to call strlen() to get the password length the check if it is <= 9. If you really wrote all that code you posted you should have no problem checking for length.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Another thing to consider, what if the user enters 15 characters? All you read are the first 9 and he thinks his password is longer than it is. You should probably accept more characters and give an error if 10 or more are entered.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944