70,020
社区成员




typedef struct
{
float score1;
float score2;
float score3;
char id[10];
char name[20];
}zzz_t;
zzz_t human[60];
char str[100] = {'\0'};
char strtemp[100] = {'\0'};
然后从数据库获取数据之后,打印出来
sprintf(str,"%.2f,%.2f",human[0].score3,human[0].score2);
sprintf(strtemp,"%f,%f",human[0].score3,human[0].score2);
printf(" %d %d \n",sizeof(zzz_t),sizeof(float));
printf(" %.2f %.2f \n",human[0].score3,human[0].score2);
printf(" %s \n",str);
printf(" %s \n",strtemp);
打印结果
44 4
82.20 67.30
-1.#J 67.30
-1.#IND00 67.30
就 human[0].score3 这一个地方出现问题,其他都打印正常