读书人

FILE 写txt资料

发布时间: 2012-10-05 15:34:34 作者: rapoo

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);

读书人网 >C++

热点推荐