A pointer is said to be opaque if the definition of the type to which it points to is not
Tag: C interview questions
C interview questions, These are very important interview questions specially for experienced as well freshers.
Q64 What is segmentation fault?
The segmentation fault is a programming error, means the program is trying to access an invalid memory location or memory
Q63 What is memory leak?
Suppose we have dynamically allocate a chunk of memory and forgot to de allocate it, means the program allocates some
Q59 Where local variable and pointer variable gets memory.
Local variable gets memory in stack and dynamically allocated memory for pointer variable gets space in heap. Explain memory mapping.
Q58 What is constant expression required error in array?
Is below statement is correct? int value = 20; int arr[value]; Compiler will through error like Constant expression required while
Q55 What is difference and purpose of using exit() and return() in a function?
exit() is used to exit our program and return control to the operating system and return() is used to return
Q43 Write a C program to reverse odd bits or even bits of an integer.
For reversing each odd bits of a given number, simply do XOR ’^’ each of its 4 hex parts with
Q40 Write a C program to count number of bits set in an integer.
The simplest way is, use bitwise ‘&’ operator on each bit of number by shifting right one by one and
Q39 How to check a particular bit is set or not? Write a program to count number of bits set in an integer.
There are many methods to check a particular bit is set or not. Method 1: Suppose I want to check
Q38 What is storage class and its type?
To know the answer please click on this link C Storage class.