Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I have a "Could not open ____ for reading" How can call for another file?

+1 vote
asked Dec 19, 2020 by Ricardo Maravilla (130 points)
I create this file and was given another file to test some inputs, with my code how can I call for the other file?

1 Answer

0 votes
answered Dec 21, 2020 by xDELLx (10,500 points)
Maybe dont hardcode the filename ,but take it as a argument to the program(argc ,argv ).

Or ask the user to enter the filename (at runtime eg scanf filename)  and try to open the file later & check if it exists.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...