#include <stdio.h>
#include <process.h>
FILE *fp;
fp=fopen("C://rect.txt","a");//参数a表示追加写入
fprintf(fp,"%d ,",rect.left);//left,top,right,bottom is Pointer of the tow points,they are int type
fprintf(fp,"%d ,",rect.top);
fprintf(fp,"%d ,",rect.right);
fprintf(fp,"%d/n",rect.bottom);
fclose(fp);
说明:
1.%d:写入整形数据
2.%f:写入浮点型数据
3.%s:写入字符串型数据