#include <stdio.h>
#include <string>
using namespace std;
#define MAX 500
void main()
{
FILE *fp;
FILE *fpout;
string fname = "G:\\TestExample\\filept\\中文路径\\BeginGame.txt";
string sResultName = "G:\\TestExample\\filept\\中文路径\\输出的文件.txt";
fp = fopen(fname.c_str(),"r+");
fpout = fopen(sResultName.c_str(),"w+");
if((!fp)||(!fpout))
{
printf("FILE not found .\n");
return;
}
char arr[MAX+1];
while((fgets (arr, MAX, fp)) != NULL)
{
fputs (arr, fpout);
}
fclose(fp);
fclose(stdout);
}