相关题目
fwrite 函数的一般调用形式是( )。
fgetc 函数的作用是从指定文件读入一个字符, 该文件的打开方式必须是( )。
若调用fputc函数输出字符成功, 则其返回值是( )。
设有以下结构体类型:
struct st
{ char name [ 8 ] ;
int num ;
float s[ 4 ] ;
} student[ 50 」 ;
并且结构体数组student 中的元素都已有值, 若要将这些元素写到硬盘文件fp 中, 以下不正确的形式是( )。
阅读以下程序及对程序功能的描述, 其中正确的描述是( ) 。
# include
main ( )
{
FILE *in , *out ;
char ch , infile [ 10 ] , outfile [ 10 ] ;
printf (“Enter the infile name : \ n” ) ;
scanf (“ % s”, infile ) ;
printf ( “Enter the outfile name : \n” ) ;
scanf ( " % s " , outfile ) ;
if ( ( in = fopen ( infile ,”r " ) ) = = NULL )
{
printf ( “cannot open infile \ n”) ;
exit ( 0 ) ;
}
if ( ( out = fopen ( outfile , “w” ) ) ==NULL )
{
printf (”cannot open outfile \n”) ;
exit ( 0 ) ;
}
while ( !feof (in))fputc(fgetc(in), out) ;
fclose ( in ) ;
fclose ( out ) ;
}
函数调用语句:fseek(fp,-20L,2);的含义是( )。
利用fseek 函数可实现的操作是( )。
fseek 函数的正确调用形式是( )。
函数rewind 的作用是( )。
函数ftell ( fp) 的作用是( )。
