Top

Memory Allocation

91.

Which of the following is an example for non linear data type?

Answer: A

A data structure is said to be linear if its elements form a sequence or a linear list. For example array, linked list, queue, stack etc. Elements in a non linear data structure do not form a sequence. For example Trees, graphs etc.

Enter details here

92.

Which of the following will return a result most quickly for searching a given key?

Answer: D

None

Enter details here

Answer: C

At first it preprocess the code, then compile it, after that it creates assembly level code, or object code, then the linking is taken place.

Enter details here

Answer: B

None

Enter details here

95.

Point out the error in the following program.

#include
#include

int main()
{
    int *a[3];
    a = (int*) malloc(sizeof(int)*3);
    free(a);
    return 0;
}

 

Answer: B

We should store the address in a[i]

 

Enter details here

96.

Specify the 2 library functions to dynamically allocate memory?

Answer: C

2 library functions to dynamically allocate memory is malloc() and calloc().

Enter details here

97.

Which of the following header files must necessarily be included to use dynamic memory allocation functions?

Answer: A

stdlib.h is a header file which stands for the standard library. It consists of the declaration for dynamic memory allocation functions such as malloc(), calloc(), realloc() and free.

Enter details here

98.

If malloc() successfully allocates memory it returns the number of bytes it has allocated.

Answer: B

No Explanation.

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