//----Returns the length of s1 (This is in a library) int strlen(char TheString[]) { int Length; Length = 0; while (TheString[Length] != '\0') { ++Length; } return(Length); }
(<type>) <expression>
A problem arises when chars are compared with ints on machines which do not provide sign extension. The char is converted to int for the comparison and will always be positive. Thus if the int is negative the two can never be equal. An important case of this is when EOF is -1. This is the reason for using an int to hold characters returned by getchar().