Memory Allocation - Objective type Interview question with answers on C Programming

Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

Questions
1 With every use of memory allocation function, what function should be used to release allocated memory which is no longer needed?
A dropmem()
B dealloc()
C release()
D free()

Answer: Option [D]

The library function free() is used to deallocate the memory that is no longer be used. This deallocated memory is dynamically allocated by malloc, calloc and realloc previously.

2 Physically placing the machine instructions and data into main memory is done by
A Linker
B Loader
C Code Generator
D Interpreter

Answer: Option [B]
Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP
3 Which header file should be included to use function like malloc() and calloc()?
A memory.h
B stdlib.h
C string.h
D dos.h

Answer: Option [B]

The stdlib.h header file contains malloc(), calloc() and realloc() dynamically allocated array functions.

4 How will you free the allocated memory?
A remove(variable-name);
B free(variable-name);
C delete(variable-name);
D dealloc(variable-name);

Answer: Option [B]
5 Which data structure is used by malloc() for object creation?
A Heap
B Tree
C Stack
D Queue

Answer: Option [A]

Random GK Questions

ADRE 2.0 FULL LENGTH MOCK TEST

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters

Assam Direct Recruitment Test Series

Computer Science Topics