quote:
Originally posted by TheSteve
Keep in mind that strlen() will only work if your string has a null character at the end. In the case of scanf, it should be null terminated as long as the user doesn't input more than 19 characters. (more than that and the program could crash or just act strangely of course.)
Yes, of course.
If I was taugth right, the last thing that '%s' adds to the sequence is '\0'. So this is the 'null character' you mentioned.