CString str = "Hello World"; TCHAR ch = str.GetAt(0); // ch now contains 'H'
CString str = "Goodbye World"; for (int i = 0; i < str.GetLength(); i++) { TCHAR ch = str.GetAt(i); // do something with ch }In this example, a for loop is used to iterate over each character in the CString object. The GetAt method is used to retrieve each character in turn, which is then processed in some way. The CString class is part of the MFC (Microsoft Foundation Class) package library, which is a set of C++ classes used for developing Windows applications.