Partager via


CStringT::AppendFormat

Appends formatted data to an existing CStringT object.

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

Parameters

  • pszFormat
    A format-control string.

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

  • argument
    Optional arguments.

Remarks

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.

Example

// 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);

Requirements

Header: cstringt.h

See Also

Reference

CStringT Class

Other Resources

CStringT Members