Help on C programming
buffer = (char*) malloc (length);
Can you explain to me the meaning of "malloc" in this command ? Thanks |
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. |
malloc just returns an area of contiguous memory to do with as you please,
sort of like asking for enough rope ;) |
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. |