CString str = "Hello World!"; str.SetString("New String value");
CString str1 = "Hello"; CString str2 = " World!"; str1.SetString(str1 + str2);In this example, we concatenate two CString objects using the + operator and set the value of str1 to the concatenated string using the SetString function. Package library: MFC (Microsoft Foundation Class) library.