c++ has a function tolower.This function is a function that processes strings.Converts uppercase to lowercase. Upcase refers to ABCDEFGHIJKLMNOPQRSTUVMXYZ converted to abcdefghijklmnopqrstuvwxyz.Non-alphabetic characters are not processed.For example, 1, 2, 3!Equal characters are header files that are output in the original characters: in VC6.0, they can be ctype.h or stdlib.hOf course, this function is a bit special in its usage. It deals with characters, not strings.The so-called inability to process strings does not mean that he cannot process strings. When he processes strings, he must process them character by character and cannot process strings at one time.The following procedure also illustrates this problem.
One thing needs to be explained here is that the string str inside here contains a transition character'' \n', and no transition character will be output here. This transition character is a special output or a transition character, that is to say, the function of the transition character after output 123 or the function of the transition character,
The final result is: (The following two methods are used to output str. The answer is the same, so only one result is output again)
press any key to continue。...
You can run it yourself, and learn to draw inferences from other cases that you don't understand.
int main ()
char str="Test String123.\n\n";In this case, the conversion symbol is unchanged, no matter what kind of style is used for output.
//char c=tolower(str);//cannot directly convert arrays or strings to lowercase