C Programming - Memory Allocation - Discussion

Discussion Forum : Memory Allocation - General Questions (Q.No. 2)
2.
What function should be used to free the memory allocated by calloc() ?
dealloc();
malloc(variable_name, 0)
free();
memalloc(variable_name, 0)
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 1 of 3.

Anonmyous said:   8 years ago
@N. Gayathridevi.

In c++ editor goto help and look for alloc.h.

In that header file examples are given.
(1)

MalliReddy said:   8 years ago
In C editor goto alloc.h you will find answer to this question and other memory management func:'s.
(2)

Bindu said:   8 years ago
Memory allocated by malloc and calloc are deallocated by free in C.
(1)

N.Gayathridevi said:   8 years ago
Explain malloc and calloc with example?
(1)

Geetha said:   8 years ago
What is the purpose of malloc?
(1)

Alex said:   9 years ago
Memory allocated by malloc or calloc : deallocated by free().
Memory allocated by new(in c++) : deallocated by delete().
(1)

Tuks bande said:   10 years ago
Is the following statement a declaration or definition?

extern int i;

A. Declaration B. Definition
C. Function D. Error

Answer & Explanation

Answer: Option A.

Explanation:

Declaring is the way a programmer tells the compiler to expect a particular type, be it a variable, class/struct/union type, a function type (prototype) or a particular object instance. (ie. extern int i).

Declaration never reserves any space for the variable or instance in the program's memory; it simply a "hint" to the compiler that a use of the variable or instance is expected in the program. This hinting is technically called "forward reference".

Suvrajeetlenka said:   10 years ago
Can anybody explain what is free() and farfree()?

Vinay said:   1 decade ago
Also Calloc() initialize the allocated memory to zero, while malloc() doesn't.
(1)

Soundaryakumari .b said:   1 decade ago
free() : Releases the specified block of memory back to the system.


Post your comments here:

Your comments will be displayed after verification.