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()

Nick Smith avatar

Nick Smith