C Languages Interview Questions

13. How do you close the file?
  The file is closed by the statement fclose(file_pointer);
 
Your Name Your Email-ID
Your Answer
14. What is the difference between Logical AND and Bitwise AND?
 
  • Logical AND (&&): Only used in conjection with two expressions, to test more than one condition. If both the conditions are true then returns 1.
    If false then return 0.
  • Bitwise AND (&): Only used in bitwise manipulation. It is an Unary operator.
 
Your Name Your Email-ID
Your Answer
15. 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.
 
Your Name Your Email-ID
Your Answer
16. 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.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 4 of 15