Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » C++ » malloc() & free() in C programming

Interview Questions and Answers on malloc() & free() in C : (10)


Question: 1

(A) Allocated memory has undefined value
(B) It returns pointer to the allocated space
(C) Pointer is NULL if memory is not allcoated
(D) It doesn't lead to memory leak if memory is not de allocated

Compiler Forum
Beginner malloc_free[Posted by: Admin | Chicago, USA]



Question: 2

(A) True
(B) False

Compiler Forum
Beginner malloc_free[Posted by: Admin | Chicago, USA]



Question: 3

(A) 999
(B) 10
(C) 0
(D) Segmentation fault

Compiler Forum
Expert malloc_free[Posted by: Admin | Chicago, USA]



Question: 4

(A) NULL
(B) cppbuzz
(C) Nothing is printed
(D) Typecasting Error

Compiler Forum
Expert malloc_free[Posted by: Admin | Chicago, USA]



Question: 5

(A) Program runs smoothly
(B) Compilation Error
(C) Runtime Error- Program crashes

Compiler Forum
Expert malloc_free[Posted by: Admin | Chicago, USA]



Question: 6

(A) True
(B) False

Compiler Forum
Practionar malloc_free[Posted by: Admin | Chicago, USA]



Question: 7

(A) Program runs smoothly & nothing is printed
(B) Runtime Error : Crash
(C) Compilation Error
(D) None of these

Compiler Forum
Practionar malloc_free[Posted by: Admin | Chicago, USA]



Question: 8

(A) Program runs smoothly
(B) Compilation Error
(C) Program runs smoothly but has memory leak
(D) Runtime Error : Crash

Compiler Forum
Practionar malloc_free[Posted by: Admin | Chicago, USA]



Question: 9

(A) Compilation Error
(B) Runtime Error: Crash
(C) Program runs smoothly but has memory leak
(D) Program runs smoothly & nothing is printed

Compiler Forum
Practionar malloc_free[Posted by: Admin | Chicago, USA]



Question: 10

(A) _ptr is NULL 0x21f3010 @
(B) _ptr not NULL 0x21f3010 @
(C) Runtime Error: Segmentation Fault
(D) _ptr not NULL 0x21f3010

Compiler Forum
Expert malloc_free[Posted by: Admin | Chicago, USA]



Compile C code here |  Upload C Questions

Browse C Categories

Preprocessor Assembler Compilation Datatypes Arrays Variables Pointers Functions Loops Switch Structures Union Enum Goto & Labels Storage Classes Malloc & free Macros Conditional Operators File Handling gcc Others

Switch to C++ Questions