CStdString str1("Hello"); CStdString str2(" World!"); str1.append(str2); // str1 now equals "Hello World!"
CStdString str1("The quick brown "); str1.append("fox jumps over the lazy dog."); // str1 now equals "The quick brown fox jumps over the lazy dog."This example is similar to the first one, but we're working with only one CStdString object. We start by setting the initial value of str1 to "The quick brown ". We then append the string "fox jumps over the lazy dog." onto the end of it using the append function. Package Library: Since CStdString is a part of the MFC (Microsoft Foundation Class) library, it is available through the Microsoft Visual C++ compiler. It is not a standalone package library.