C/stdio.h/sprintf — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 10:23, 25 мая 2010
sprintf: is identical to printf() except that the output is a char array
//Declaration: int sprintf(char *buf, const char *format, ...);
//Return: returns the number of characters actually placed into the array.
#include <stdio.h>
int main(void){
char str[80];
sprintf(str,"%s %d %c", "one", 2, "3");
printf("%s", str);
}
/*
one 2 3*/