LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Help on C programming (https://www.linuxquestions.org/questions/programming-9/help-on-c-programming-570281/)

anhtt 07-17-2007 11:28 PM

Help on C programming
 
buffer = (char*) malloc (length);
Can you explain to me the meaning of "malloc" in this command ?
Thanks

jschiwal 07-17-2007 11:34 PM

malloc is short for memory allocate. It returns a void pointer. A void pointer can be typed to different types of structures.

See the "man malloc" manpage.

bigearsbilly 07-18-2007 02:01 AM

malloc just returns an area of contiguous memory to do with as you please,
sort of like asking for enough rope ;)

Wim Sturkenboom 07-18-2007 05:25 AM

Homework ?

If you use Linux, learn how to use the manpages (man malloc would have given you the answer).
If you have an internet connection, you can search for man malloc and get the answer as well.


All times are GMT -5. The time now is 03:27 PM.