Поделиться через


CSimpleStringT::CopyChars

Copies a character or characters to a CSimpleStringT object.

static void CopyChars(
   XCHAR* pchDest,
   const XCHAR* pchSrc,
   int nChars
) throw( );

Parameters

  • pchDest
    A pointer to a character string.

  • pchSrc
    A pointer to a string containing the characters to be copied.

  • nChars
    The number of pchSrc characters to be copied.

Remarks

Call this method to copy characters from pchSrc to the pchDest string.

Example

The following example demonstrates the use of CSimpleStringT::CopyChars.

CSimpleString str(_T("xxxxxxxxxxxxxxxxxxx"), 20, pMgr);
TCHAR* pszSrc = _T("Hello world!");

_tprintf_s(_T("%s\n"), str);

str.CopyChars(str.GetBuffer(), pszSrc, 12);
_tprintf_s(_T("%s\n"), str);

Requirements

Header: atlsimpstr.h

See Also

Reference

CSimpleStringT Class

Other Resources

CSimpleStringT Members