read a file as a string C code example
Example 1: c read a whole string from a file
#define _GNU_SOURCE //Necessary for getline to work with clang in Ubuntu
getline(&line, &len, fp);
Example 2: read string c
char name[20];
scanf("%s", name);
#define _GNU_SOURCE //Necessary for getline to work with clang in Ubuntu
getline(&line, &len, fp);
char name[20];
scanf("%s", name);