fscanf用法

来源:互联网 发布:亚拉腊山 知乎 编辑:程序博客网 时间:2024/05/21 08:56

float 七位double 十五位

用fscanf时一定要注意,格式一定要跟要读取的数据相匹配,否则读出来的数据是错误的。

 

 float coorX = 0.0;float coorY = 0.0;float rotate = 0.0;float XInter = 0;float YInter=0;int nLn = 0;int nCol = 0;
 fscanf(fp,"%f%f%f%f%f%d%d" , &coorX,&coorY,&rotate,&XInter,&YInter,&nLn,&nCol);
 int ntemp=0;
 fscanf(fp,"%d",&ntemp);

 

 

原创粉丝点击