Export C Data 20111
Export C Data 20111
#include <string>
int main()
// and .at()
// we can modify individual characters in the string with the [] syntax too
test1[2] = 'C';
test1 += "qrstu";
test1.append("vwxyz");
// the length() function is a synonym for size(), it returns the same value
cout << "length: " << test1.length() << endl;
string test3;
test3.clear();
// we can convert values like ints and doubles to strings using to_string()
// we can store use input into a string type variable, for example a name
string name;
// will only store the string up until the first space character, so a
// name like 'kevin browne' will only be stored as 'kevin' into name
// will store the string up until the first newline character into name,
getline(cin, name);
return 0;