F
Flash Gordon
James Kuyper wrote, On 21/12/08 18:49:
Because the values get passed to tolower which expects either EOF or a
positive value. Although in this case all the characters are in the
basic character set and so guaranteed to be positive whether char is the
same as signed or unsigned char, but one assumes that those are not
necessarily the strings to be used in the "real" program.
Anthony said:Keith said:"Anthony Fremont" <[email protected]> writes:unsigned char Ptr[SIZE][MAXSTRLEN] =
{"HeArd","DiaMoNd","SprAde","AbC"}; [snip]
The disadvantage is that it allocates the maximum size for each
string. (And plain char would make more sense here than unsigned
char.)
Why would "plain" char make more sense? Leaving it unspecified leaves
it up to the implementation and means that I would need to cast it to
unsigned anyway. I don't get it.
Why would you need to convert to unsigned?
Because the values get passed to tolower which expects either EOF or a
positive value. Although in this case all the characters are in the
basic character set and so guaranteed to be positive whether char is the
same as signed or unsigned char, but one assumes that those are not
necessarily the strings to be used in the "real" program.