//////////////////////////////////////////////////////// // string.cpp - how do I use a standard C++ string? // //////////////////////////////////////////////////////// #include #include using namespace std; void main() { string s = "this is a string"; s += " that has been added to"; s += " two times"; cout << "\n " << s << "\n\n"; cout << " its first three characters are: " << s[0] << ", " << s[1] << ", and " << s[2] << "\n\n"; cout << " its size is " << s.size() << " characters\n\n"; s.erase(); s = "this is a new set of character contents"; cout << " " << s << "\n\n"; }