Sorry, but I'm not at a computer with a compiler right now and I want to know if this algorithm will work in my latest program.
Code:
char * base[8] = {0};
char * pBase = 0;
char * buf[4];
char buf2[1024] = {0};
int i;
fgets(buf2, 1024, '\n');
pBase = strtok(buf2, ' ');
for(i = 0; i < 8 && *p != '\0'; i++){
base[i] = *p;
pBase = strtok(NULL, ' ');
}
for(i = 0; i < atoi(base[7]); i++){
fgets(buf[i], 1024, '\n');
}
This code reads a string into a buffer, then parses the tokens in that string into an array of pointers to char. One of the tokens will determine how much of the file to read after parsing the string and that value is used as a condition for a loop to read the rest of the file needed.
The big question is, will this work?