Use a while loop with the condition set to something like "!strcmp(user_input, "quit")" and then simply ask the user for a file name each iteration then run it through your solver. If the user enters "quit" the loop will break exiting your software. User input can be done many ways but I prefer using fgets() on STDIN. This is because you can prevent stack overflows since you can specify the size of your buffer which will hold the filename to parse.
It may look something like this:
Code
#include <headers>
int main() {
char user_input[41] = {0};
printf("Enter a file name to parse or quit\n");
fgets(STDIN, 40, user_input);
while(!strcmp(user_input, "quit") {
//read the file using the user_input varaible as the file name
//run it through your solver functions
printf("Enter a file name to parse or quit\n");
fgets(STDIN, 40, user_input);
}
return 0;
}
This post was edited by AbDuCt on Feb 9 2017 07:31pm