November 2001
Beginner
1128 pages
29h 12m
English
There are three overloaded assignment methods:
basic_string& operator=(const basic_string& str); basic_string& operator=(const charT* s); basic_string& operator=(charT c);
The first assigns one string object to another, the second assigns a C-style string to a string object, and the third assigns a single character to a string object. Thus, all of the following operations are possible:
string name("George Wash");
string pres, veep, source;
pres = name;
veep = "Road Runner";
source = 'X';
Read now
Unlock full access