若磁盘上已存在某个文本文件,其全路径文件名为d:\ncre\test.txt,下列语句中不能打开该文件的是

admin2013-05-30  25

问题 若磁盘上已存在某个文本文件,其全路径文件名为d:\ncre\test.txt,下列语句中不能打开该文件的是

选项 A、ifstream file("d:\ncre\test.txt");
B、ifstream file("d:\\ncre\\test.txt");
C、ifstream file;file.open("d:\\ncre\\test.txt");
D、ifstream*pFile=new ifstream("d:\\ncre\\test.txt");


答案A

解析 文件流的打开路径用“\\”隔开,而不是“\”,但可以用“/”隔开。
转载请注明原文地址:https://kaotiyun.com/show/yGNp777K
0

最新回复(0)