Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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: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

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

Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  

If the size of int data type is two bytes, what is the range of signed int data type?

0 Answers  


4 Answers  

please give code for this 1 2 4 7 11 16

8 Answers   Intel, Wipro,

what is the role you expect in software industry?

2 Answers   HCL, Wipro,

7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

0 Answers  

i=10,j=20 j=i,j?(i,j)?i:j:j print i,j

1 Answers   CSC,

program to find the magic square

1 Answers   Infosys,

How will you find a duplicate number in a array without negating the nos ?

0 Answers  

What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

0 Answers  

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?

8 Answers   Google,

What is a buffer in c?

0 Answers