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 is the method to save data in stack data structure type?

832


why return type of main is not necessary in linux

1860


List out few of the applications that make use of Multilinked Structures?

1691


What is the difference between new and malloc functions?

788


Explain how does flowchart help in writing a program?

840






How can I get random integers in a certain range?

773


What is break in c?

780


What is the concatenation operator?

789


What is the -> in c?

774


simple program of graphics and their output display

1677


How can I determine whether a machines byte order is big-endian or little-endian?

809


Explain what is the difference between functions getch() and getche()?

771


What is string concatenation in c?

752


how to capitalise first letter of each word in a given string?

1652


What is console in c language?

807