I have a file with multiple strings, each string on a separate line. All strings are 32 character long (so 33 with the \'\\n\' at the end).
I am trying to read all t
Here is a basic approach:
// create an line array of length 33 (32 characters plus space for the terminating \0)
char line[33];
// read the lines from the file
while (!feof(fp)) {
// put the first 32 characters of the line into 'line'
fgets(line, 32, fp);
// put a '\0' at the end to terminate the string
line[32] = '\0';
// print the result
printf("%s\n", line);
}