How to input a file when I do not know the name

Feb 4, 2016 at 9:12pm
I know how to read in text files when I know the name ("input.txt", etc.) and in the past when I did not know the name I would prompt the user to input it. But in this assignment meant it does not allow me to do either. Is there a way for my program to check for a text file in the project folder or something? It's my teacher's first year and he is being quite vague. I can post my code if anyone wants to see it.
Feb 4, 2016 at 9:31pm
Whether or not this is possible (I dont actually know), you should firstly email your teacher and ask him to clarify the assignment.
Feb 4, 2016 at 10:01pm
Perhaps input redirection or command line arguments?
Feb 5, 2016 at 4:20am
I would google it, lots of examples
Feb 5, 2016 at 4:35am
TarikNeaj + 1
Ask your teacher for clarification. A good way to put it would be something like:

"My understanding is that I am not allowed to ask the user for the input file name. I don't understand how I am supposed to get it from him unless I ask. Is there a way that you want me to do this?"

Hope this helps.
Topic archived. No new replies allowed.