Tuesday, February 9, 2010

The MAGIC of SPRINTF

sprintf()

Syntax:

#include
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" );
//*****************************************************************************//

No comments:

Post a Comment