what is mallloc()?how it works?

Answer Posted / ravi chandra

malloc function is used to allocate some space in memory for
the current program that we are running.
malloc() function actually return s the value of the address
of the memory in the memory segment
c=malloc();
it gives the address to the variable c.


h=malloc(sizeof(struct node));
it returns the address of structure for the variable h;
some h=1000; (address value)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are volatile variables in c?

524


What are loops in c?

553


Differentiate between a for loop and a while loop? What are it uses?

677


How do c compilers work?

613


Can I initialize unions?

596






What are the advantages of union?

630


How many parameters should a function have?

670


How do you determine a file’s attributes?

605


What do you mean by Recursion Function?

634


How can you convert integers to binary or hexadecimal?

621


what is the significance of static storage class specifier?

1667


What is hashing in c?

646


What are the data types present in c?

631


What does %p mean?

598


What is storage class?

657