题目内容

要在D盘MyDir目录下新建一个MyFile.txt文件用于写,正确的语句是( )。

A. FILE *fp=fopen("D:\MyDir\MyFile.txt","W");
B. FILE *fp; fp=fopen("D:\\MyDir\\MyFile.txt","W");
C. FILE *fp; fp=fopen("D:\MyDir\MyFile.txt","r");
D. FILE *fp; fp=fopen("D:\\MyDir\\MyFile.txt","r");

查看答案
更多问题

fscanf函数的正确调用形式是( )。

A. fscanf(文件指针,格式字符串,输出列表)
B. fscanf(格式字符串,输入列表,文件指针)
C. fscanf(格式字符串,文件指针,输出列表)
D. fscanf(文件指针,格式字符串,输入列表)

下面程序运行后的结果是( )。#includeint main(){ FILE *fp; int i,m=9,n=9; fp=fopen("d:\\test.txt","w"); for(i=0;i<5;i++)fprintf(fp,"%d",i); fclose(fp); fp=fopen("d:\\test.txt","r"); fscanf(fp,"%d%d",&m,&n); fclose(fp); printf("m=%d,n=%d\n",m,n); return 0;}

A. m=1,n=2
B. m=9,n=9
C. m=1234,n=9
D. m=1,n=234

有以下程序#includeint main(){ FILE *fp; fp=fopen("filea.txt","w"); fprintf(fp,"abc"); fclose(fp); return 0;}若文本文件filea.txt中原有内容为“hello”,则运行以上程序后,文件filea.txt中的内容为( )。

A. helloabc
B. abclo
C. abc
D. abchello

How does the man face his life after suffering great misfortune?(video 1)

A. He keeps a positive attitude toward life and benefits a lot from adversity.
B. He is defeated by the setback.

答案查题题库