Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

_scprintf, _scwprintf

Return the number of characters in the formatted string.

int _scprintf(
   const char *format [,
   argument] ... 
int _scwprintf(
   const wchar_t *format [,
   argument] ... 


Format-control string.
Optional arguments.

For more information, see Format Specifications.

Return Value

Returns the number of characters that would be generated if the string were to be printed or sent to a file or buffer using the specified formatting codes. The value returned does not include the terminating null character. _scwprintf performs the same function for wide characters.


Each argument (if any) is converted according to the corresponding format specification in format. The format consists of ordinary characters and has the same form and function as the format argument for printf.

Security Note   Ensure that format is not a user-defined string.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_sctprintf _scprintf _scprintf _swprintf


Routine Required header Compatibility
_scprintf <stdio.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP
_scwprintf <stdio.h> or <wchar.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.


All versions of the C run-time libraries.

See Also

Stream I/O Routines | fprintf | printf | scanf | sscanf | vprintf Functions | Run-Time Routines and .NET Framework Equivalents

© 2015 Microsoft