Check out example codes for "c read a whole string from a file". It will help you in understanding the concepts better.

Code Example 1

#define  _GNU_SOURCE  //Necessary for getline to work with clang in Ubuntu
getline(&line, &len, fp);

Learn ReactJs, React Native from akashmittal.com