Thank you very much. Maybe you can answer this question too: how can I write test cases for my program, keeping in mind it has to read from files? I'm used to using "assert" for tests, by copying my program into a header file and then writing a main function with a bunch of assert statements. In this case, I can't exactly use assert. Is there a statement that opens a file and let's scanf read from it?