C Languages Interview Questions

41. How many arguments can be passed to a function in C?
 
  • Any number of arguments can be passed to a function.
  • There is no limit on this.
  • Function arguments are stored in stack memory rather than heap memory. Stack memory allocation is depending on the operating system.
  • So, any number of arguments can be passed to a function as much as stack has enough memory. Program may crash when stack overflows.
 
Your Name Your Email-ID
Your Answer
42. 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
43. 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
44. What is meant by protocol?
  Protocol is nothing but a set of rules to be followed by a programmer.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 11 of 15