C Programming Interview Questions and Answers for Freshers - 1

Question: 1

Is it possible to create your own header files?

Yes, it is possible to create a customized header file.

Just include in it the function prototypes that you want to use in your program, and use the #include directive followed by the name of your header file.

Question: 2

What is “##” operator in C?

## is a pre-processor macro in C. It is used to concatenate 2 tokens into one token.

Question: 3

Can you pass an entire structure to functions?

Yes, it is possible to pass an entire structure to a function in a call by method style.

However, some programmers prefer declaring the structure globally, and then pass a variable of that structure type to a function.

This method helps maintain consistency and uniformity in terms of arguments type.

Question: 4

What is the difference between memcpy() & strcpy() functions in C?

memcpy() function is used to copy a specified number of bytes from one memory to another. Whereas, strcpy() function is used to copy the contents of one string into another string.

memcpy() function acts on a memory rather than value. Whereas, strcpy() function acts on value rather than memory.

Question: 5

What are actual arguments?

When you create and use functions that need to perform an action on some given values, you need to pass these given values to that function.

The values that are being passed into the called functions are referred to as actual arguments.

Related Questions