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.

How do I use a text file input with GDB online in C++?

+1 vote
asked Nov 23, 2023 by John Tupps (130 points)
I have a program written that I feel is correct. It is my first time using a .txt file for input. I run the program with no errors but the answers are all 0.00 for the calculations. I feel that the compiler is not accessing the .txt file input. Is that because it is an online compiler? How does it link with the computer that is running the program?

1 Answer

+1 vote
answered Nov 24, 2023 by Peter Minarik (86,240 points)
Files on your computer cannot be accessed from OnlineGDB. You can add the file to your project via the UPLOAD FILE button left of the green RUN button. Then you can refer to the file with a relative path.

If this doesn't quite help, please, share your code.
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.
...