niusouti.com

若磁盘上已存在某个文本文件,其全路径文件名为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");

题目

若磁盘上已存在某个文本文件,其全路径文件名为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");


相似考题
更多“若磁盘上已存在某个文本文件,其全路径文件名为d:\ncre\test.txt,下列语句中不能打开该文件的是A. ”相关问题
  • 第1题:

    若磁盘上已存全路径文件名为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:\etest\test.txt");


    正确答案:D

  • 第2题:

    objFSO.OpenTextFile(“a.txt”,1,True)的第三个参数意义是什么?

    A.以只读的方式打开文本文件 B.以附加到文件后面的方式打开

    文本文件

    C.若打开的文件不存在,就建立 D.若打开的文件不存在,仍不建


    正确答案:
     

  • 第3题:

    当已存在一个test.txt文件时,执行函数fopen("test.txt","r+")的功能是()。

    A.打开test.txt文件,覆盖原有的内容

    B.打开test.txt文件,可以读取和写入新的内容

    C.打开test.txt文件,只能写入数据,但不能读取数据

    D.打开test.txt文件,只能读取原有内容,但不能写数据


    打开abc.txt文件,可以读取和写入新的内容

  • 第4题:

    设有语句:Open"d:\Test.txt"ForOutput As#1,以下叙述中错误的是( )。

    A.若d盘根目录下无Test.txt文件,则该语句创建此文件

    B.用该语句建立的文件的文件号为1

    C.该语句打开d盘根目录下一个已存在的文件Test.txt,之后就可以从文件中读取信息

    D.执行该语句后,就可以通过Print#语句向文件Test.txt中写入信息


    正确答案:C

  • 第5题:

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

    A.ifstream file("d:\shiti\test.txt");

    B.ifstream file("d:\\shiti\\test.txt");

    C.ifstream file;file.open("d:\\shiti\\test.txt");

    D.ifstream* pFile = new ifstream("d:\\shiti\\test.txt");


    正确答案:A