what are the various memory handling mechanisms in C ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

941


What does 3 periods mean in texting?

600


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

713


Is it possible to execute code even after the program exits the main() function?

819


What is spark map function?

582






What are the restrictions of a modulus operator?

638


Why do we use static in c?

634


Why can't I perform arithmetic on a void* pointer?

639


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

661


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1860


Explain the process of converting a Tree into a Binary Tree.

2107


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2985


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1262


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

695


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1636