generate output into a fixed-length string
#include <stdio.h> int _bprintf( char *buf, unsigned int bufsize, const char *format, ... );
The _bprintf() function is equivalent to the sprintf() function, except that the argument bufsize specifies the size of the character array buf into which the generated output is placed. A null character is placed at the end of the generated character string. The format string is described under the description of the printf() function.
The _bprintf() function returns the number of characters written into the array, not counting the terminating null character. An error can occur while converting a value for output. When an error has occurred, errno contains a value indicating the type of error that has been detected.
cprintf(), errno, fprintf(), printf(), sprintf(), _vbprintf(), vcprintf(), vfprintf(), vprintf(), vsprintf()
#include <stdio.h> void main( int argc, char * argv[] ) { char file_name[9]; char file_ext[4]; _bprintf( file_name, 9, "%s", argv[1] ); _bprintf( file_ext, 4, "%s", argv[2] ); printf( "%s.%s\n", file_name, file_ext ); }
WATCOM
All (except DOS/PM)