Check out example codes for "allocating memory for 1Mb text file in C". It will help you in understanding the concepts better.

Code Example 1

char *one_MB_file = (char*) malloc(sizeof(char));

Learn ReactJs, React Native from akashmittal.com