kfrght 大大的回复改成这样就更完美了! void __fastcall TForm1::Button1Click(TObject *Sender) { if(!OpenDialog1->Execute()) { return; } FILE * outf; // 定义一个文件指针 outf=_wfopen(OpenDialog1->FileName.w_str(),L"rb"); }
void __fastcall TForm1::Button1Click(TObject *Sender) { if(!OpenDialog1->Execute()) { return; } FILE * outf; // 定义一个文件指针 outf=_wfopen(OpenDialog1->FileName.w_str(),L"rb"); }
第一、在XE系列中使用 FILE ,需要引用stdio.h库 #include <stdio.h> // 引用stdio.h库 第二、在XE系列中已经默认使用宽字符,建议使用配套的宽字符函数_wfopen读写文件 #include <stdio.h> // 引用stdio.h库 void __fastcall TForm1::Button1Click(TObject *Sender) { FILE * outf; // 定义一个文件指针 if(OpenDialog1->Execute()) { outf=_wfopen(OpenDialog1->FileName.w_str(),L"rb"); } }
604
社区成员
13,457
社区内容
加载中
试试用AI创作助手写篇文章吧