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

无法进行文件操作,该如何处理

2012-02-09 
无法进行文件操作程序无法创建和读取ntfs分区上的文件。代码如下:ifstreamfoutfout.open( f:\array.txt

无法进行文件操作
程序无法创建和读取ntfs分区上的文件。代码如下:
ifstream   fout;
fout.open   ( "f:\array.txt ");
srand   (   (unsigned)   time   (   NULL   ));
if   (fout)
{
for   (int   i   =   0;   i   <   100000;   i++)
{
fout < <rand   ()   %   100000 < <endl;
}
cout < <fout.is_open   () < <endl;
}
else
{
cerr < < "error:   unable   to   open   input   file. " < <endl;
return;
}
fout.close   ();

[解决办法]
"f:\\array.txt "
兄弟,别太浮躁了。编程是一个极需要沉得住气的行当。

热点排行