This topic has not yet been rated - Rate this topic

CStringT::AppendFormat

Appends formatted data to an existing CStringT object.

void __cdecl AppendFormat(
   PCXSTR pszFormat,
   [, argument]...
);
void __cdecl AppendFormat(
   UINT nFormatID,
   [, argument]...
);
pszFormat

A format-control string.

nFormatID

The string resource identifier that contains the format-control string.

argument

Optional arguments.

This function formats and appends a series of characters and values in the CStringT. Each optional argument (if any) is converted and appended according to the corresponding format specification in pszFormat or from the string resource identified by nFormatID.

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

CAtlString str = _T("Some data:\t");

str.AppendFormat(_T("X value = %.2f\n"), 12345.12345);
_tprintf_s(_T("%s"), (LPCTSTR) str);

Header: cstringt.h

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.