C Programming - Memory Allocation

Why C Programming Memory Allocation?

In this section you can learn and practice C Programming Questions based on "Memory Allocation" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

Where can I get C Programming Memory Allocation questions and answers with explanation?

IndiaBIX provides you lots of fully solved C Programming (Memory Allocation) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download C Programming Memory Allocation quiz questions with answers as PDF files and eBooks.

Where can I get C Programming Memory Allocation Interview Questions and Answers (objective type, multiple choice)?

Here you can find objective type C Programming Memory Allocation questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.

How to solve C Programming Memory Allocation problems?

You can easily solve all kind of C Programming questions based on Memory Allocation by practicing the objective type exercises given below, also get shortcut methods to solve C Programming Memory Allocation problems.

1. 

Which header file should be included to use functions like malloc() and calloc()?

A. memory.h
B. stdlib.h
C. string.h
D. dos.h

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

2. 

What function should be used to free the memory allocated by calloc() ?

A. dealloc();
B. malloc(variable_name, 0)
C. free();
D. memalloc(variable_name, 0)

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

3. 

How will you free the memory allocated by the following program?

#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4

int main()
{
    int **p, i, j;
    p = (int **) malloc(MAXROW * sizeof(int*));
    return 0;
}

A. memfree(int p);
B. dealloc(p);
C. malloc(p, 0);
D. free(p);

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

4. 

Specify the 2 library functions to dynamically allocate memory?

A. malloc() and memalloc()
B. alloc() and memalloc()
C. malloc() and calloc()
D. memalloc() and faralloc()

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.