首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若磁盘上已存全路径文件名为c:\ctest\test.txt的文件,下面语句中不能打开该文件的是( )。
若磁盘上已存全路径文件名为c:\ctest\test.txt的文件,下面语句中不能打开该文件的是( )。
admin
2012-12-29
28
问题
若磁盘上已存全路径文件名为c:\ctest\test.txt的文件,下面语句中不能打开该文件的是( )。
选项
A、ifstream *pFile=new ifstream(“c:\\ctest\\test.txt”);
B、ifstream file(“c:\\ctest\\test.txt”);
C、ifstream file;file.open(“c:\\ctest\\test.txt”);
D、ifstream file(“c:\ctest\test.txt”);
答案
D
解析
由于“\”在C++中用来定义转义字符,所以必须对文件名字符串中的“\”进行转义,所以只有选项D)不正确。
转载请注明原文地址:https://kaotiyun.com/show/VuVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有代数式,(其中e仅代表自然对数的底数,1不是变量),则下列能够正确表示该代数式的C语言表达式是()。
在软件生产过程中,需求信息的来源是()。
在软件生命周期中,能准确地确定软件系统必须做什么和必须具备哪些功能的阶段是()。
已知一个文件中存放若干工人档案记录,其数据结构如下:structa{charnumber[100];intage;floatp[6];};定义一个数组:structanumber[10];
运行下面的程序,输入字符串“MicrosoftVisua1Studio”,则程序的执行结果是()。#inc1udemain(){charChr[20];scanf("%s",&Chr);p
N名学生的成绩已在主函数中放入一个带头节点的链表结构中,h指向链表的头节点。请编写函数fun,其功能是:求出平均分,并由函数值返回。例如,若学生的成绩是:8576698591726487,则平均分应当是:78.625。注意:部分源程序在文件PROGl.
设有某函数的说明为int*func(inta[10],intn);则下列叙述中,正确的是()。
若变量已正确定义为int型,要通过语句scanf("%d,%d,%d",&a,&b,&c);给a赋值1、给b赋值2、给c赋值3,以下输入形式中错误的是(注:□代表一个空格符)()。
下列语句中存在语法错误的是()。
随机试题
消化道平滑肌对下列哪项刺激不敏感?
下列关于临界胶束浓度的叙述中正确的是()
"亢则害,承乃制"说明了五行之间的
上颌第二、第三磨牙的牙体长轴
属于化学药与中成药配伍禁忌的是
关于法院可以在诉讼中主动依职权采取的措施中,下列说法正确的是:()
法律格言说:“不知自己之权利,即不知法律。”关于这句法律格言涵义的阐释,下列哪一选项是正确的?(2010年卷一6题)
下列有关具体审计目标的说法中,正确的有()。
“走出去”战略是我国发展的根本基点。()
The"formallearning"referstoalllearningwhichtakesplaceintheclassroomregardlessofwhethersuchlearningis______byc
最新回复
(
0
)