When designing a header file, it is important to remember the difference between the definition and the declaration. The definition can only occur once,
The declaration can appear multiple times (2nd. 3.5). Definition, so should not be put
In the header file:
C + + Primer Chapter III notes standard library type string
1. The fully qualified standard library name must be used in the header file
The header file is copied into our program code, causing the program using the header file to use the
using namespace Std; or using std::string; such as
2. String S;cin >> s;
At this point, all whitespace characters in the front are skipped, and the characters are read again until the white space character stops
3. EOF, the while termination condition in this code
int main () { string word; // read until end-of-file, writing each Word to a new line while (cin >> word) cout << word << Endl; return 0
4.getline reads content until a newline is encountered, directly encounters a newline, string is empty getline (CIN, line)
Operation of 5.string objects
S.empty (), S is a string, returns True, or returns False, S.size (), s[n], s1+s2,s1 = s2, V1 = v2,! =, <, <=, >,>=
6.string::size_type type
Functions in 7.cctype
Isalnum (c) True if C is a letter or a number.
Isalpha (c) True if C is a letter.
Iscntrl (c) True if C is the control character
IsDigit (c) True if C is a number.
Isgraph (c) True if C is not a space but printable.
Islower (c) True if C is a lowercase letter.
Isprint (c) True if C is a printable character.
Ispunct (c) True if C is a punctuation mark.
Isspace (c) True if C is a white-space character.
Isupper (c) True if C is an uppercase letter.
Isxdigit (c) True if it is a C hexadecimal number.
ToLower (c) If C capital letter, return its lowercase letter form, otherwise directly return C.
ToUpper (c) If C is a lowercase letter, it returns its uppercase form, otherwise it returns C directly.
Most return 0 indicates success
C + + Primer Note string