I need to save lines from a text file into a string and then insert them into a data structure, but with my solution (which I assume is really bad) - I only save words into my line.
FILE * ifile = fopen("input.txt", "r");
char line[256];
while(fscanf(ifile, "%s\n", line) == 1) {
//inserting "line" into data structure here - no problem with that one
}
Aucun commentaire:
Enregistrer un commentaire