CString::operator =

This assignment (=) operator reinitializes an existing CString object with new data. If the destination string — that is, the left side — is already large enough to store the new data, no new memory allocation is performed. You should be aware that memory exceptions may occur whenever you use the assignment operator because new storage is often allocated to hold the resulting CString object.

At a Glance

Header file: Afx.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 1.0 and later
Complete documentation: Visual C++ documentation

Syntax

const CString& operator =( const CString& stringSrc );
throw( CMemoryException );

const CString& operator =( TCHAR ch ); throw( CMemoryException );

const CString& operator =( const unsigned char* psz );
throw( CMemoryException );

const CString& operator = ( LPCWSTR lpsz ); throw( CMemoryException );

const CString& operator =( LPCSTR lpsz ); throw( CMemoryException );

See Also

CString::CString