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 to load a .dat file to be read in online GDB?

+7 votes
asked Nov 6, 2025 by alisha58 (190 points)
Hello,

I need to read and analyze data from a file.

Do I save the file to My Projects, in order to access it and read from it??

1 Answer

0 votes
answered Nov 7, 2025 by Peter Minarik (101,420 points)
Yes, that's right.

Online GDB runs on a server, and your program can only access resources available on the server.

Adding your input file to your project is your best solution.

If, for some reason, the .dat extension confuses the compiler, call it a .txt file instead; that should work and be ignored by the compiler.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...