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 open a file called Random.txt that i put in my files? I am using Chromebook.

+1 vote
asked Feb 24, 2022 by Joshua Elias (270 points)
Is there a way to open this file I have in my files with a Chromebook? And if so, how do I read the numbers inside this file to use for later equations.

3 Answers

0 votes
answered Feb 24, 2022 by Peter Minarik (73,840 points)

What language are we talking about? You want to programmatically open a file and read content from it right?

I've made a small example for you in C++. Please, check out the sample project. You can fork from it and edit it to your liking.

0 votes
answered Apr 2, 2022 by userdotexe (1,340 points)

Since you have a Chromebook, wouldn't you just go into the Files app, find the file Random.txt and double click it?

If you did this, the Chrome browser should open a new tab with the entirety of the file's content on the screen.


0 votes
answered Apr 2, 2022 by Dakota Bell (200 points)

To upload a file into the OnlineGDB editor, look to the left of the green "run" button used to run your program. Select the image of the arrow pointing to the cloud-- this is the "Upload file" button. You can also hover over it for a tooltip to appear.

Reading the numbers from the file into a program varies between each language, so we need to know what language you are using: common languages are python, java, c, c++, etc... 

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.