Currently At: Programming Reference > C Reference > Stndard C I/O > sprintf()

sprintf()


Syntax:
#include <stdio.h>
int sprintf( char *buffer, const char *format, ... );


Description:
The sprintf() function is just like |printf()|, except that the output is sent to buffer. The return value is the number of characters written.

Example:
char string[50];
int file_number = 0;
    
sprintf( string, "file.%d", file_number );
file_number++;
output_file = fopen( string, "w" );


Related Topics:
printf(), fsprintf()


Web Standards & Support:

Link to and support eLook.org Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! eLook.org FireFox Extensions