Skip to content

Instantly share code, notes, and snippets.

@daniilgri
Last active February 14, 2019 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniilgri/2e4601779ab2e6e8de4f5271fcaf8157 to your computer and use it in GitHub Desktop.
Save daniilgri/2e4601779ab2e6e8de4f5271fcaf8157 to your computer and use it in GitHub Desktop.
List* ReadFromFile(char* name, char* lname) {
FILE* f = fopen(name, "r");
char *a;
if(!f) {
printf("Ошибка открытия файла");
}
List *list = CreateList(lname, "info");
while(fgets(a, 100,f)) {
if(!feof(f)) {
AddHead(list, a);
} else {
break;
}
}
fclose(f);
return list;
}
fclose(f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment