转自:百度百科 http://baike.baidu.com/view/10100911.htm
编辑本段简介
编辑本段声明
编辑本段参数
pszDest
cchDest
pszFormat
其他···
编辑本段注意
结果
编辑本段实例
编辑本段相关函数
-
扩展阅读:
-
- 1
Remarks
- 2
StringCchPrintf provides additional processing for proper buffer handling in your code. Poor buffer handling is implicated in many security issues that involve buffer overruns. StringCchPrintfalways null-terminates a non-zero-length destination buffer.
- 3
StringCchPrintf can be used in its generic form, or specifically as StringCchPrintfA (for ANSI strings) or StringCchPrintfW (for Unicode strings). The form to use is determined by your data.
- 4
char"string"StringCchPrintfATCHARTEXT("string")StringCchPrintfWCHARL"string"StringCchPrintfW
- 5
StringCchPrintf and its ANSI and Unicode variants are replacements for these functions:
- 6
sprintfswprintfwsprintfwnsprintf_stprintf_snprintf_snwprintf_sntprintf
- 7
Behavior is undefined if the strings pointed to by pszDest, pszFormat, or any argument strings overlap.
- 8
Neither pszFormat nor pszDest should be NULL. See StringCchPrintfEx if you require the handling of null string pointer values.
- 1