I\'m just reading about malloc() in C.
malloc()
The Wikipedia article provides an example, however it justs allocate enough memory for an array of 10 ints in com
In the example you described int array[10] goes away when you leave your stack frame. If you would like the used memory to persist beyond local scope you have to use malloc();
int array[10]