Version 3 (modified by 14 years ago) ( diff ) | ,
---|
StrFmt
Format a string with a format specifier and a variable number of parameters.
string StrFmt(const char* pszFmt, ...);
Parameters
- pszFmt - character array of formatting information
- ... - variable number of parameters to fill in formatting specifiers
Return Value
- Returns the formatted string
Remarks
This is basically a wrapper around sprintf to provide the flexibility of formatting with some safety measures built in. If string parameters are used the ".c_str()" method will be needed to convert this to C style strings. Refer to http://www.cplusplus.com/reference/clibrary/cstdio/printf/ for formatting specifiers.
Example
string strMsg; strID = "123"; strMsg = StrFmt("ID: %s", strID.c_str());
See Also
Note:
See TracWiki
for help on using the wiki.