sscanf sprintf

来源:互联网 发布:网络十大女主播排名 编辑:程序博客网 时间:2024/06/01 07:38
void main()
{


char buf[100] = {0};
int num;
char c[50];
double x;
sprintf(buf, "%d %s %lf",12,"nima",3.1595);
sscanf(buf,"%d %s %lf",&num,c,&x);
printf("%s\n",buf);
printf("%d %s %lf",num,c,x);
}
2 0