fscanf(ifile, "%c", &jnk);
/* If there's a height, this will be a ". if not, it'll be a ,*/
if ((jnk = '\"') || (jnk != ',')) {
printf("%c", jnk);
while(fscanf(ifile, "%c", &data) && data != ',' && data != '\"' && data != '\'') {
printf(" %c ", data);
weight[a]= data;
a++;
}
weight[a] = '\0';
player[n].weight=atof(weight);
printf("%.0f ", player[n].weight);
} else if(data == ' ' || data == ',') {
player[n].weight= 0;
printf("%.0f ", player[n].weight);
}
GDB 告诉我将数据存储到重量中会给我 seg 错误。谁能告诉我为什么?