下面函数的作用是以双倍行距输出文件:void test(ifstream&outf,ofstream&outC) {char c;while(______){______;if(c=='\n')outc.put(C) ;}}下划线处缺失的代码是( )。A.outf.put(C) 与outc.get(C)B.outf.put(C) 与outc.get(C)C.outf.get(C) 与outc.put?D.outf.get(C) 与outc.put?

题目

下面函数的作用是以双倍行距输出文件:

void test(ifstream&outf,ofstream&outC) {

char c;

while(______){

______;

if(c=='\n')outc.put(C) ;

}

}

下划线处缺失的代码是( )。

A.outf.put(C) 与outc.get(C)

B.outf.put(C) 与outc.get(C)

C.outf.get(C) 与outc.put?

D.outf.get(C) 与outc.put?


相似考题
更多“下面函数的作用是以双倍行距输出文件: void test(ifstream&outf,ofstream&outC) { char ”相关问题
  • 第1题:

    char *GetMemory(void){ char p[] = "hello world";return

    p; }void Test(void){char *str = NULL;str = GetMemory(); printf(str);}请问运行 Tes

    t 函数会有什么样的结果?


    正确答案:
     

  • 第2题:

    void Test(void){char *str = (char *)

    malloc(100); strcpy(str, “hello”); free(str); if(str != NULL) { strcpy(str, “

    world”); printf(str);}}请问运行 Test 函数会有什么样的结果?


    正确答案:
     

  • 第3题:

    下面的程序执行后,文件test中的内容是 void fun(char *fname, char *st) { FILE *myf; int i; myf=fopen (fname, "w"); for(i=0; i<strlen(st); i++) fputc(st[i], myf); fclose(myf); } int main(void){ fun("test", "new world"); fun("test", "hello,"); return 0; }

    A.new worldhello,

    B.hello,

    C.new world

    D.hello,rld


    A

  • 第4题:

    Void GetMemory2(char **p, int num){*p = (char *)malloc(num);}void

    Test(void){char *str = NULL;GetMemory(&str, 100);strcpy(str, "hello"); printf(str); }请问

    运行Test 函数会有什么样的结果?


    正确答案:
     

  • 第5题:

    设有以下函数:

    voidfun(intn,char}s){……}

    则下面对函数指针的定义和赋值均正确的是( )。

    A.void(*pf)(int,char);pf=&fun;

    B.void+pf( );pf=fun;

    C.void*pf( );*pf=fun;

    D.void(*pf)(int,char*);pf=fun;


    正确答案:D
    函数的参数可以是指针类型。它的作用是将一个变量的地址传送到另一个函数中。函数名代表函数的人口地址,指向函数的指针应该定义为void(+pf)()。如果定义为void·pf(),则表示函数pf返回值为一个基类型为void的指针。因此D选项正确。