Dynamic Memory Allocation in C using malloc()