C Tutorial – The functions malloc and free | CodingUnit Programming Tutorials
One last tip before we end the tutorial: Always use sizeof. Never use this notation malloc(4). (Requesting 4bytes for the integer in the examples). This will make your code much more portable. If you look at the dynamic memory functions of the stdlib.h li...