I'm finishing up a schoolproject in C.
I was doing a helpfunction, wich should print information onto the console, the information is in a .txt file
Code:
#include <conio2.h>
#include <stdio.h>
#include <stdlib.h>
void help(void) {
char line[80];
FILE *help;
help = fopen ("help.txt", "r");
if (help == NULL)
{
printf("help.txt kan niet geopend worden!");
}
do {
fscanf(help,"%[^/n]",line);
printf("%s/n",line;
} while (!feof(help));
fclose(help);
getch();
}
the function seems to be in a non-stop loop, printing only the first part of the txt-file
if I put only a few words into it, it works fine, but when I put a whole text in the file, it goes crazy