I wrote this function to read a line from a file:
const char *readLine(FILE *file) { if (file == NULL) { printf(\"Error: file pointer is null.\"
FILE* filePointer; int bufferLength = 255; char buffer[bufferLength]; filePointer = fopen("file.txt", "r"); while(fgets(buffer, bufferLength, filePointer)) { printf("%s\n", buffer); } fclose(filePointer);