ExamVeda
Login
Home
11
What is the result of the expression &variable in C, where variable is a variable of type int?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
12
In C, what is a double pointer (int**)?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
13
What is the result of the expression ptr = NULL in C, where ptr is a pointer?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
In C, what is the purpose of the 'malloc' function?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
What is the result of the expression *NULL in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
16
In C, what is the purpose of the 'memcpy' function?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
17
What is the result of the expression sizeof(char*) in C, assuming a char pointer on a typical system?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
18
In C, how do you declare an array of pointers to integers?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
What is the purpose of the 'free' function in C when used with pointers?
Discuss
Answer & Solution
Answer: Option B
Solution:
The 'free' function in C is used to deallocate memory that was previously allocated using functions like malloc, calloc, or realloc.

When memory is allocated dynamically, it resides in the heap, and it is the programmer's responsibility to release that memory when it is no longer needed.

Using 'free' helps prevent memory leaks by returning the allocated memory back to the system.

Option A is incorrect because allocating memory is done using malloc, calloc, or realloc.

Option C is incorrect because 'free' does not create new pointers.

Option D is incorrect because 'free' does not modify the value of the pointer; it only releases the memory the pointer points to.

Therefore, the correct answer is Option B: Deallocate memory.
20
In C, what is a pointer to a constant value (const int*)?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board