1 What is a string? The string isAn array of characters ending with a null character (\ 0).
The ASSII code for the null character is: 0, the ASCII code for the space is 32
The role of 2
That is, a null character is the closing tag, such as Cin,cout. They all end with a null character, and they will stop typing or outputting after encountering a null character.
Cin.ignore (a,ch) extracts characters from the input stream (CIN), and the extracted characters are ignored (ignore) and are not used. Each discarded one character,
It counts and compares characters: if the count reaches a or the discarded character is CH, the Cin.ignore () function terminates; otherwise, it continues to wait
The default parameter is Cin.ignore (1,eof), which is to Fu Qing the 1 characters before EOF and clear one character without encountering EOF
One of its most common functions is to clear the contents of input buffers that end with a carriage return, eliminating the effect of the last input on the next input.
The end tag of 4 cin.get (char[], n) is a newline character. Therefore, a whitespace character (a space, tab) is encountered and does not end. At the same time, after the input is finished, that is, when the user enters the first carriage return, Cin.get automatically
So it actually saves the valid character is its second parameter minus 1.
18: String-char type String