friend CArchive& operator <<( CArchive& ar, const CString& string );
throw(CArchiveException);
friend CArchive& operator >>( CArchive& ar, CString& string );
throw(CArchiveException);
friend CDumpContext& operator <<( CDumpContext& dc, const CString& string );
The CString insert (<<) operator supports diagnostic dumping and storing to an archive. The extract (>>) operator supports loading from an archive.
The CDumpContext operators are valid only in the Debug version of the Microsoft Foundation Class Library.
// Operator << >> example
extern CArchive ar;
CString s( "abc" );
#ifdef _DEBUG
afxDump << s; // Prints the value (abc)
afxDump << &s; // Prints the address
#endif
if( ar.IsLoading() )
ar >> s;
else
ar << s;