Question-111. What is array in C ?
Answer- Array is a group of similar types of elements. It has contiguous memory location. It makes the code optimized, easy to traverse and easy to sort.
Question-112. What is pointer in C ?
Answer- A pointer is a variable that refers to the address of a value. It makes the code optimized and makes the performance fast.
Question-113. What are the usage of pointer in C ?
Answer- Accessing array elements
Dynamic memory allocation
Call by Reference
Data Structures like tree, graph, linked list etc.
Question-114. What is far pointer in C ?
Answer- A pointer which can access all the 16 segments (whole residence memory) of RAM is known as far pointer.
Question-115. What is static memory allocation ?
Answer- In case of static memory allocation, memory is allocated at compile time and memory can’t be increased while executing the program. It is used in array.
Question-116. What is dynamic memory allocation ?
Answer- In case of dynamic memory allocation, memory is allocated at run time and memory can be increased while executing the program. It is used in linked list.
Question-117. What functions are used for dynamic memory allocation in C language ?
Answer-
malloc() calloc() realloc() free()
Question-118. What is structure ?
Answer- Structure is a user-defined data type that allows to store multiple types of data in a single unit. It occupies the sum of memory of all members.
Question-119. What is union ?
Answer- Like Structure, union is a user-defined data type that allows to store multiple types of data in a single unit. But it doesn’t occupies the sum of memory of all members. It occupies the memory of largest member only.
Question-120. Can we compile a program without main() function ?
Answer- Yes, we can compile but it can’t be executed.
But, if we use #define, we can compile and run C program without using main() function. For example:
#include #define start main void start() { printf("Hello"); }