C Programming Question and Answers

89. What is the difference between memcpy() and memmove() functions in C?
 
  • memcpy() functions is used to copy a specified number of bytes from one memory to another.
  • Memmove () function is used to copy a specified number of bytes from one memory to another or to to overlap on same memory.
  • Difference between memmove() and memcpy() is, overlap can happen on memmove(). Whereas, memory overlap won't happen in memcpy() and it should be done in non destructive way.
 
Your Name Your Email-ID
Your Answer
90. What is a newline escape sequence?
  A newline escape sequence is represented by the \n character. This is used to insert a new line when displaying data in the output screen. More spaces can be added by inserting more \n characters. For example, \n\n would insert two spaces. A newline escape sequence can be placed before the actual output expression or after.
 
Your Name Your Email-ID
Your Answer
91. Suppose a global variable and local variable have the same name. Is it is possible to access a global variable from a block where local variables is defined?
  No. It is not possible in C. It is always the most local variable that gets preference.
 
Your Name Your Email-ID
Your Answer
92. What is a sequential access file?
 
  • When writing programs that will store and retrieve data in a file, it is possible to designate that file into different forms.
  • A sequential access file is such that data are saved in sequential order: one data is placed into the file after another.
  • To access a particular data within the sequential access file, data has to be read one data at a time, until the right one is reached.
 
Your Name Your Email-ID
Your Answer