CString::operator <<, >>

friendCArchive&operator<<(CArchive&ar,constCString&string);
throw(CArchiveException);

friendCArchive&operator>>(CArchive&ar,CString&string);
throw(CArchiveException);

friendCDumpContext&operator<<(CDumpContext&dc,constCString&string);

Remarks

The CString insertion (<<) operator supports diagnostic dumping and storing to an archive. The extraction (>>) operator supports loading from an archive.

The CDumpContext operators are valid only in the Debug version of the Microsoft Foundation Class Library.

Example

The following example demonstrates the use of CString::operator <<, >>.

// example for CString::operator <<, >>
    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;

CString OverviewClass MembersHierarchy Chart

See Also   CDumpContext