CSimpleStringT::operator +=

Joins a new string or character to the end of an existing string.

CSimpleStringT& operator +=( 
   PCXSTR pszSrc  
); 
CSimpleStringT& operator +=( 
   const CSimpleStringT& strSrc  
); 
template< int t_nSize > 
CSimpleStringT& operator+=( 
   const CStaticString< XCHAR, t_nSize >& strSrc 
); 
CSimpleStringT& operator +=( 
   char ch  
); 
CSimpleStringT& operator +=( 
   unsigned char ch  
); 
CSimpleStringT& operator +=( 
   wchar_t ch  
);

Parameters

  • pszSrc
    A pointer to a null-terminated string.

  • strSrc
    A pointer to an existing CSimpleStringT object.

  • ch
    The character to be appended.

Remarks

The operator accepts another CSimpleStringT object or a character. Note that memory exceptions may occur whenever you use this concatenation operator because new storage may be allocated for characters added to this CSimpleStringT object.

Example

The following example demonstrates the use of CSimpleStringT::operator +=.

CSimpleString str(_T("abc"), pMgr);
ASSERT(_tcscmp((str += _T("def")), _T("abcdef")) == 0);   

Requirements

Header: atlsimpstr.h

See Also

Reference

CSimpleStringT Class