更多"执行以下程序后,test.txt文件的内容是【 】。(若文件能正常"的相关试题:
[单项选择]执行以下程序后,test.txt文件的内容是【 】。(若文件能正常打开)
#include
main( )
{FILE * fp;
char*sl="Fortran",*s2="Basic";
if((fp=fopen("test.txt","wb"))==NULL)
{printf("Can’t open test.txt file\n");exit(1);}
fwrite(sl,7,1,fp);/*把从地址sl开始的7个字符写到fp所指文件中*/
fseek(fp,0L,SEEK_SET);/*文件位置指针移到文件开头*/
fwrite(s2,5,1,fp);
fclose(fp);
}
A. Basican
B. BasicFortran
C. Basic
D. FortranBasic
[单项选择]执行以下程序后,test.txt文件的内容是(若文件能正常打开) ( )。
#include <stdio.h>
#include <stdlib.h>
main( )
FILE * fp;
char * s1 = "Fortran" , * s2 = "Basic";
if((fp = fopen( "test. txt" ," wb" )) = = NULL)
prinff( "Can’t open test. txt file /n"); exit(1);
fwrite( s1 ,7,1 ,fp); /* 把从地址s1开始到7个字符写到fp所指文件中*/
fseek(fp,OL,SEEK_SET); /*文件位置指针移到文件开头*/
fwrite (s2,5,1,fp);
felose (fp);
A. Basiean
B. BasieFortran
C. Basic
D. FortranBasie
[单项选择]执行以下程序后,test.txt文件的内容是(若文件能正常打开)()。
#include<stdio.h>
main( )
FILE*fp;
char*s1="Fortran",*s2="Basic";
if((fp=fopen("test.txt","wb"))==NULL)
printf("Can't open test.txt file/n");exit(1);
fwrite(s1,7,1,fp);/*把从地址s1开始的7个字符写到fp所指文件中*/
fseek(fp,0L,SEEK_SET);/*文件位置指针移到文件开头*/
fwrite(s2,5,1,fp);
fclose(fp);
A. Basican
B. BasicFortran
C. Basic
D. FortranBasic
[单项选择]执行以下程序后,test.txt文件的内容是(若文件能正常打开)______。
#include
main( ) FILE *fp;
char *s1="Fortran",*s2="Basic";
if((fp=fopen("test.txt","wb"))==NULL)
printf("Can′t open test.txt file/n");exit(1);
fwrite(s1,7,1,fp); /*把从地址s1开始的7个字符写到fp所指文件中*/
fseek(fp,0L,SEEK_SET); /*文件位置指针移到文件开头*/
fwrite(s2,5,1,fp);
fclose(fp);
A. Basican
B. BasicFortran
C. Basic
D. FortranBasic
[单项选择]执行以下程序后,test.txt文件的内容是(若文件能正常打开)______。
#include<stdio.h>
main( )
FILE*fp;
char*s1="Fortran",*s2="Basic";
if((fp=fopen("test.txt","wb")==NULL)
printf("Can’t open test.txt file/n");exit(1);
fwrite(s1,7,1,fp);/*把从地址s1开始的7个字符写到fp所指文件中*/
fseek(fp,0L,SEEK_SET);/*文件位置指针移到文件开头*/
fwrite(s2,5,1,fp);
fclose(fp);
A. Basican
B. BasicFortran
C. Basic
D. FortranBasic
[填空题]以下程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
FILE*fp;
if(((fp=fopen("test.txt","r"))=______))
printf("未能打开文件!/n");
else
printf("文件打开成功!/n");
[填空题]以下程序用来判断指定文件是否能正常打开。请填空。
#include<stdio.h>
main( )
{ FILE *fp;
if(((fp=fopen("test.txt", "r"))==______))
printf("未能打开文件!/n");
else printf("文件打开成功!/n");
}
[填空题]
以下程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
{FILE*fp;
if(((fp=fopen("test.txt","r"))=()))
printf("未能打开文件!/n");
else
printf("文件打开成功!/n");
}