C - Files and Preprocessors

C - Files and Preprocessors
11. The default stream pointers available during execution of a program is
  • stdin
  • stdout
  • stderr
  • all the above
Show Answer
12. The function call fopen ("data", "w+b")
  • is invalid
  • returns the file pointer pointing to file named data and opern the file for reading and writing using binary stream
  • returns the file pointer pointing to file named data and opens the file for reading and writing using text stream
  • does not return file pointer
Show Answer
13. If fopen ( ) fails, it returns
  • -1
  • NULL
  • 1
  • the file pointer
Show Answer
14. The function fclose ( ) is
  • used to disconnect a program from file
  • used to close a file logically
  • both options a and b
  • a mandatory function call in file handling
Show Answer
15. The action of connecting a program to a file is obtained by using I
  • connect ( )
  • fopen ( )
  • OPEN ( )
  • file ( )
Show Answer
16. The action of disconnecting a program from a file is obtained by the function
  • fclose ( )
  • delete ()
  • fdisconnect ()
  • clear ( )
Show Answer
17. The value returned by fclose(), if an error occurs is
  • 0
  • 1
  • EOF
  • -1
Show Answer
18. The value returned by fclose ( ) for successful closing of a file is
  • 0
  • 1
  • EOF
  • OK
Show Answer
19. The function(s) used  for reading a character from a file is (are)
  • ggetc()
  • fgetc()
  • both options a and b
  • fgetchar()
Show Answer
20. The function(s) used for reading formatted input data from a file is (are)
  • putc( )
  • fputc( )
  • both options a and b
  • fputchar ( )
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test