71 - string Class and string Functions

#include 
#include 
using namespace std;

int main()
{
    string s1("hampster  ");
    string s2;
    string s3;
    s2 = s1;
    s3.assign(s1);
    cout << s1 << s2 << s3 << endl;

    string s4 = "cvbnm";
    cout << s4.at(3) << endl;
    for(int x=0;x

你可能感兴趣的:(71 - string Class and string Functions)