I have a .txt file with "./a.out,file.txt,./a.out2,file2.txt"
How can I store "./a.out", "file.txt", "./a.out" and "file2.txt"?
I was trying to use fgets() and sscanf().
while (fgets(buffer, 80, fp) != NULL) {
sscanf(line, "%s, %s, %s, %s\n", a, b, c, d);
printf("a = %s\n", a);
printf("b = %s\n", b);
printf("c = %s\n", c);
printf("d = %s\n", d);
}
[but if i print them out, i will read the whole inline into char* a]