hi i have the following code below, where i try to get all the lines of a file into an array... for example if in file data.txt i have the following:
first ...
#include #include #include int main(int argc, char **argv) { FILE *f; int c; errno = 0; /Check for no. of arguments and try opening file/ if (argc == 1) { printf("There is no file selected.\n"); printf("Usage: test \n"); } else { for (int i = 1; i < argc; i++) { if((f = fopen(argv[i], "r")) == ...
I am trying to read data back into an array from a file. This basically is so I can save state of arrays to disk and then re-create that state later. It's not really a series of records... I don't think the stream concept is the solution for me here... I have one long record... many many (hundreds of thousands) of ...