C Language Interview Questions and Answers - 3

Question: 11

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.

Question: 12

What is “&” and “*” operators in C?

“*” Operators is used as pointer to a variable.

Example: * a where * is pointer to the variable a.

& operator is used to get the address of the variable. Example: &a will give address of a.

 

Question: 13

What is a syntax error?

Syntax errors are associated with mistakes in the use of a programming language.

It may be a command that was misspelled or a command that must was entered in lowercase mode but was instead entered with an upper case character.

A misplaced symbol or lack of symbol, somewhere within a line of code can also lead to syntax error.

 

Question: 14

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.

Question: 15

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.

Related Questions