Create a string base on the start and end of another string : string create « Data Types « C++ Tutorial






#include <string>
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    const string hello("Hello, how are you?");

    string s(hello.begin(),hello.end());

    // iterate through all of the characters
    string::iterator pos;
    for (pos = s.begin(); pos != s.end(); ++pos) {
        cout << *pos;
    }
    cout << endl;

}
Hello, how are you?








2.23.string create
2.23.1.Create a string base on the start and end of another string
2.23.2.displays a string with pointer notation
2.23.3.copies one string to another with pointers