C - Files and Preprocessors Questions and Answers

Practice Mode
Showing 10 of 96 questions
Q61
Which of the following is the correct function prototype for the function main ( ) ?
  • A main (char argc, char *argv)
  • B main (int argc, int *argv)
  • C main (int argc, int **argv [ ] )
  • D main ( int argc, char * argv [ ] )
Answer: Option D
Q62
Which is more correct ? 'int main (int argc, char ** argv)' 'int main (int argc, char* argc [ ] )'?
  • A both are equally wrong.
  • B both are equally correct.
  • C neither is correct
  • D in main (int argc, char *argv[])
Answer: Option B
Q63
The function used to position the file pointer in C is
  • A seekg( )
  • B fseekg( )
  • C fseek( )
  • D fileseek( )
Answer: Option C
Q64
The function used to position the file pointer in C is
  • A seekg()
  • B fseekg ()
  • C fseek()
  • D fileseek()
Answer: Option C
Q65
What file I/O function is used to report the number of bytes from the beginning of the file to the file position indicator ?
  • A ftell
  • B freport
  • C fseek
  • D fcount
Answer: Option A
Q66
1. fcloseall() 2. clearerr() 3. ferror() Which o the above are valid ANSI C functions ?
  • A only option 3
  • B only option 2
  • C only options 2 and 3
  • D options 1, 2, and 3 are all valid ANSI functions.
Answer: Option C
Q67
Which standard file is to be include to use the memcpy() function without a warning in an ANSI C compiler ?
  • A string.h
  • B memory.h
  • C stdlib.h
  • D stdio.h
Answer: Option A
Q68
If there is a need to see output as soon as possible. Which function will force the output from the buffer into the output stream ?
  • A write ()
  • B output()
  • C flush ()
  • D fflush()
Answer: Option D
Q69
After a library function returns a failure, which of the following will print out the appropriate error message corresponding to error number given by errno?
  • A printf (stderr, "s\n", geterror ());
  • B printerr () ;
  • C perror (errno);
  • D strerror (errrno);
Answer: Option D
Q70
Which ANSI c standard function could be used to sort a s tring array ?
  • A qsort
  • B sort
  • C asort
  • D bsort
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test