Local variables are stored in an area called ___________
Answer: D
Local variables are stored in an area called stack. Global variables, static variables and program instructions are stored in the permanent storage area. The memory space between these two regions is known a heap.
Enter details here
What is the return type of malloc() or calloc()?
Answer: C
malloc() and calloc() return void *, without void * we may get warning in C if we don't type cast the return type to appropriate pointer.
Enter details here
Which languages necessarily need heap allocation in the run time environment?
Answer: D
No answer description available for this question.
Enter details here
The advantage of using linked lists over arrays is that ________
Answer: B
Insertion and deletion in a linked list can be done at any position. On the other hand, in an array, to insert an element at a specific position, the rest of the elements have to be moved one position to the left and to delete an element, all the elements after the deleted element have to be moved one position to the right
Enter details here
Which is the correct sequence of compilation process?
Answer: C
No explanation.
Enter details here
Which of the following is/are true
Answer: D
No answer description available for this question.
Enter details here
Consider the following program, where are i, j and k are stored in memory?
#include
#include
int i;
int main()
{
int j;
int *k = (int *) malloc (sizeof(int));
}
Answer: C
i is global variable and it is uninitialized so it is stored on BSS part of Data Segment, j is local in main() so it is stored in stack frame, *k is dynamically allocated so it is stored on Heap Segment.
Enter details here
Which one is used during memory deallocation in C?
Answer: C
None
Enter details here
calloc() returns a storage that is initialized to.
Answer: A
None
Enter details here
What will be the output of the program?
#include
#include
int main()
{
int *p;
p = (int *)malloc(20); /* Assume p has address of 1314 */
free(p);
printf("%u", p);
return 0;
}
Answer: A
No answer description available for this question
Enter details here