Ex 2: What is the output?
#include<stdio.h>
main( )
{
FILE *fp ;
char str[80] ;
fp = fopen ( "TRY.C", "r" ) ;
while ( fgets ( str, 80, fp ) != EOF )
fputs ( str ) ;
fclose ( fp ) ;
}
Ans:
Compiler error.
Explanation:
The fputs() in the above program hava only one argument.The syntax of the fputs() have two argument. So fputs() call don’t match with definition of that function. |