Category: Most Important Interview Questions In C
Most important and frequently asked C interview questions
Q67 What is dynamic memory allocation and how to allocate memory dynamically?
Please click on the link to know about DMA
Q66 What is an opaque pointer?
A pointer is said to be opaque if the definition of the type to which it points to is not
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
Q57 Write a C program to remove duplicates in a sorted array.
#include<stdio.h> int remove_duplicate(int arr[], int arr_size) { int i, j = 0; printf(“Printing original array elements\n”); for(i
Q56 What is meaning of run time error and compile time error in C?
Complie time error – An error which is identified at compile time is called compile time error. Below program will
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