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 we do a file program using gdb compiler

+6 votes
asked Oct 3, 2021 by Asst. Prof. Nimisha Philip Dept. of CSE (180 points)

2 Answers

0 votes
answered Oct 3, 2021 by samaksh Gupta (140 points)

To create a file, use either the ofstream or fstream class, and specify the name of the file. To write to the file, use the insertion operator ( << ).

commented Oct 6, 2021 by Adityakrishna vinod (100 points)
https://onlinegdb.com/Sf313wMSr


This is a simple program for creating a file and adding data into it.


You can add many ideas like , "making a text editor",.......etc .

I hope this helped , Thankyou
+1 vote
answered Oct 3, 2021 by Peter Minarik (86,040 points)

Please, be more specific as your question is really not clear.

  • What language do you use?
  • What is a "file program"?
Share any code you have already written.
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.
...