what are the various memory handling mechanisms in C ?

Answers were Sorted based on User's Feedback



what are the various memory handling mechanisms in C ?..

Answer / santhi

thre are 3 memory handling mechanisms.they are
malloc,calloc,ralloc.
malloc:which allocates memory to a variable dynamically.
calloc:which allocates blocks of memory.
ralloc: which can be used to reallocation of memory incase
of unsufficient memory which is allocated earlier.
using "delete" we can free the memory allocated to a
variable.

Is This Answer Correct ?    7 Yes 1 No

what are the various memory handling mechanisms in C ?..

Answer / henry

malloc(), calloc(), ralloc() are all for allocating memory.
free() is for freeing memory.

Is This Answer Correct ?    5 Yes 1 No

what are the various memory handling mechanisms in C ?..

Answer / priya

The malloc function allows the programmer to create a block of memory of a given size:

malloc ( long integer lBlockSize ) returns void *

If we decide, during the execution of the program, that we might need to expand, or contract this memory block, we can use the realloc function:

realloc ( void * pBlock, long int lNewBlockSize ) returns void *

When the memory block is no longer used, then it must be returned back to the operating system, by calling the free function:

free ( void * pBlock )

Is This Answer Correct ?    2 Yes 0 No

what are the various memory handling mechanisms in C ?..

Answer / venkatesh kr

In C Language we can use the malloc, calloc & ralloc for memory handling but if we use the above function we should free the memory when the memory is not required.It can be done by "free" function. And also one important point is, suppose if we allocate a memory for an structure and in the process time if the structure is not required the it should be removed by using the "free" function because the system or process will be get crashed on some situations.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


Why cd or dvd are round why not square.

1 Answers  


Explain demand paging.

1 Answers   Agilent,


In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?

1 Answers   Melstar,


What is use of bit field?

0 Answers  






Is c compiled or interpreted?

0 Answers  


Is c++ based on c?

0 Answers  


What is a pragma?

0 Answers  


What are Storage Classes in C ?

32 Answers   CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,


can we implement multi-threads in c.

0 Answers  


WHAT IS PRE POSSESSORS?

6 Answers   TATA,


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database

2 Answers   TCS, Unisys, Webyog,


Categories