int main()
{
int ddd=666;
char buffer[80];
sprintf(buffer, "The value of ddd=%d", ddd);
printf("%s\n",buffer);
return 0;
}
#include <stdlib.h>
int main()
{
int ddd=666;
char *buffer=NULL;
if((buffer = malloc(80*sizeof(char)))==NULL)
{
printf("malloc error\n");
}
sprintf(buffer, "The value of ddd = %d", ddd);
printf("%s\n",buffer);
free(buffer);
buffer=NULL;
return 0;
}