C - Files and Preprocessors

C - Files and Preprocessors
61. Which of the following is the correct function prototype for the function main ( ) ?
  • main (char argc, char *argv)
  • main (int argc, int *argv)
  • main (int argc, int **argv [ ] )
  • main ( int argc, char * argv [ ] )
Show Answer
62. Which is more correct ?
'int main (int argc, char ** argv)'
'int main (int argc, char* argc [ ] )'?

  • both are equally wrong.
  • both are equally correct.
  • neither is correct
  • in main (int argc, char *argv[])
Show Answer
63. The function used to position the file pointer in C is
  • seekg( )
  • fseekg( )
  • fseek( )
  • fileseek( )
Show Answer
64. The function used to position the file pointer in C is
  • seekg()
  • fseekg ()
  • fseek()
  • fileseek()
Show Answer
65. What file I/O function is used to report the number of bytes from the beginning of the file to the file position indicator ?
  • ftell
  • freport
  • fseek
  • fcount
Show Answer
66. 1. fcloseall()
2. clearerr()
3. ferror()
Which o the above are valid ANSI C functions ?
  • only option 3
  • only option 2
  • only options 2 and 3
  • options 1, 2, and 3 are all valid ANSI functions.
Show Answer
67. Which standard file is to be include to use the memcpy() function without a warning in an ANSI C compiler ?
  • string.h
  • memory.h
  • stdlib.h
  • stdio.h
Show Answer
68. 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 ?
  • write ()
  • output()
  • flush ()
  • fflush()
Show Answer
69. 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?
  • printf (stderr, "s\n", geterror ());
  • printerr () ;
  • perror (errno);
  • strerror (errrno);
Show Answer
70. Which ANSI c standard function could be used to sort a s tring array ?
  • qsort
  • sort
  • asort
  • bsort
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test