Example of String Assignment
// C++ string assignment
strB.assign(strA);
// The next operation is not allowed by Visual C++ 6.0
strC.assign(strA,3);
// but this is a work around ...
strC.assign(strA,3,string::npos);
strD.assign(strA,3,4);
// C string assignment
char cstring[] = "An array of char";
strE.assign(cstring,8); // value is "An array"
strF.assign("This is a C string"); // value is "This is a C string"
// Character assignment
strG.assign(10,'*'); // value is "**********"
// C++ strings, C string and chars can be assigned
// with the = operator.
strH = strA;
strI = cstring;
strJ = "Hello";
strK = 'X';