Help us and donate little Bitcoins to pay the server costs: 1AXLPuRUBYc1JczTW4XS65GL6oWjNP2Vt2

User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer







because of the inhumane working conditions at amazon in Germany, I will offer the Amazon app no more! (ARD Reportage)
c:stdio.h:sprintf

sprintf

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
    int sprintf(char *str, const char *format, ...);

Like fprintf, but output written into string s, which must be large enough to hold the output, rather than to a stream. Output is NUL-terminated. Returns length (excluding the terminating NUL).

/* 
 * sprintf example code
 * http://code-reference.com/c/stdio.h/sprintf 
 */
 
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
 
int main( void ) {
 
    char string[11];
    int integer_variable = 42;
 
   sprintf( string, "%d", integer_variable );
   printf("%s\n",string);
return 0;
}
advertising
c/stdio.h/sprintf.txt · Last modified: 2013/01/22 22:02 (external edit)

The new Question & Answer System is online and waiting for your Questions about Programming problems http://ask.code-reference.com Impressum