首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

FILE 写txt资料

2012-10-05 
FILE 写txt文件CString sx;cstring sy;FILE *fp fopen(:\\表.txt,w+)fprintf(fp,%s %s %s\n,00

FILE 写txt文件
CString sx;
cstring sy;
FILE *fp = fopen(":\\表.txt","w+");
 fprintf(fp,"%s %s %s\n","00",sx,sy);
为什么sx是“555”的时候表.txt只有一个5

[解决办法]

C/C++ code
    CString sx("555");    CString sy;    FILE *fp = fopen(":\\表.txt","w+");    fwprintf(fp,_T("%s %s\n"),sx.GetBuffer(0),sy.GetBuffer(0));    fclose(fp);
[解决办法]
探讨
C/C++ code

CString sx("555");
CString sy;
FILE *fp = fopen(":\\表.txt","w+");
fwprintf(fp,_T("%s %s\n"),sx.GetBuffer(0),sy.GetBuffer(0));
fclose(fp);

热点排行