单选题
若磁盘上已存在某个文本文件,其全路径文件名为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''); ifstream(''d:\\ncre\\test.txt'');
D、
ifstream*pFile=new
【正确答案】
A
【答案解析】
解析:此题考查的是转义字符。在字符常量或字符串中,以“\”开头的一系列字符被看做是一个转义字符。要表示“\”字符,必须使用转义字符“\\”。
提交答案
关闭