C Interview Questions
Here are some important C interview questions.
1. What is C?
C is a general-purpose programming language widely used for system programming, embedded systems and application development.
2. What is a pointer?
A pointer is a variable that stores the address of another object.
3. What is an array?
An array is a collection of elements of the same type stored in contiguous memory.
4. What is a structure?
A structure groups related variables, potentially of different types, under one name.
5. What is the difference between malloc() and calloc()?
Both allocate dynamic memory. malloc() allocates a specified number of bytes, while calloc() allocates space for multiple elements and initializes the allocated bytes to zero.
6. What is recursion?
Recursion is a technique in which a function calls itself.
7. What is a compiler?
A compiler translates source code into a form that can be executed or further processed by the target system.
8. What is the difference between structure and union?
Structure members have separate storage, while union members share the same storage.