Pr.Pg

C Programming Interview Questions and Answers Part 11

 

101.What is meant by file opening?

  • The action of connecting a program to a file is called opening of a file.

  • This requires creating an I/O stream before reading or writing the data.

 

102.What is a file pointer?

  • The pointer to a FILE data type is called as a stream pointer or a file pointer.

  • A file pointer points to the block of information of the stream that had just been opened.

 

103.What are the advantages of using array of pointers to string instead of an array of strings?

  • Efficient use of memory.

  • Easier to exchange the strings by moving their pointers while sorting.

 

104. What is getche() function?

  • It returns a character just entered from the standard input unit. The entered character is echoed (displayed) to the computer screen.

  • It reads a single character the moment it is typed without waiting for the Enter key to be hit.

 

105. What is getch() function?

  • It returns a character just entered from the standard input unit. The entered character is not echoed on the screen.

  • It reads a single character the moment it is typed without waiting for the Enter key to be hit.

 

106. What is the difference between break and continue?

  • The break statement is used to exit from all the loop constructs (while, do while and for) and switch.case statements,

  • whereas the continue statement is used to skip all subsequent instructions and can control back to the loop control.

  • The continue statement can be used for any loop construct.

Pr.Pg border