This topic has not yet been rated - Rate this topic

CStringT::operator +=

Concatenates characters to the end of the string.

CStringT& operator+=(
   const CThisSimpleString& str
);
template<
   bool bMFCDLL
>
CStringT& operator+=(
   const const CSimpleStringT<BaseType, bMFCDLL>& str
);
template<
   int t_nSize
>
CStringT& operator+=(
   const CStaticString< XCHAR, t_nSize >& strSrc
);
CStringT& operator+=(
   PCXSTR pszSrc
);
CStringT& operator+=(
   PCYSTR pszSrc
);
CStringT& operator+=(
   char ch
);
CStringT& operator+=(
   unsigned char ch
);
CStringT& operator+=(
   wchar_t ch
);
CStringT& operator+=(
   const VARIANT& var
);
str

A reference to a CThisSimpleString object.

bMFCDLL

A boolean specifying whether the project is an MFC DLL or not.

BaseType

The string base type.

var

A variant object to concatenate to this string.

ch

An ANSI or Unicode character to concatenate with a string.

pszSrc

A pointer to the original string being concatenated.

strSrc

A CStringT to concatenate to this string.

The operator accepts another CStringT object, a character pointer, or a single character. You should be aware that memory exceptions can occur whenever you use this concatenation operator because new storage can be allocated for characters added to this CStringT object.

For information on CThisSimpleString, see the Remarks section of CStringT::CStringT.

Note Note

Although it is possible to create CStringT instances that contain embedded null characters, we recommend against it. Calling methods and operators on CStringT objects that contain embedded null characters can produce unintended results.

// typedef CStringT<TCHAR, StrTraitATL<TCHAR, ChTraitsCRT<TCHAR>>> CAtlString;

CAtlString s(_T("abc"));
ASSERT((s += _T("def")) == _T("abcdef"));   

Header: cstringt.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.