#include <iostream>
using namespace std;
int main()
{
int a[300];
FILE *stream;
string str="D:\\new.tx";
string fileFullName=str;
fileFullName.append("t");
//轉換爲char類型
const char *c_file=fileFullName.c_str();
//const char *s=str.c_str();
if ((stream=fopen(c_file,"r"))!=NULL)
{
fread(a,1,5,stream);
}
else
{
printf("can't open file");
exit(1);
}
fclose(stream);
for(int i=0;i<5;i++)
{
cout<<a[i]<<endl;
}
//cout<<s<<endl;
cout<<c_file;
system("pause");
return 0;
}