Top

Memory Allocation

41.

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

42.

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

Answer: D

No answer description available for this question.

Enter details here

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

Answer: C

No explanation.

Enter details here

Answer: D

No answer description available for this question.

Enter details here

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

48.

Which one is used during memory deallocation in C?

Answer: C

None

Enter details here

49.

calloc() returns a storage that is initialized to.

Answer: A

None

Enter details here

50.

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

Loading…
Tags: Memory Allocation Questions and Answers || Memory Allocation MCQ Questions and Answers || Memory Allocation GK Questions and Answers || Memory Allocation GK MCQ Questions || Memory Allocation Multiple Choice Questions and Answers || Memory Allocation GK || GK on Memory Allocation || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming