Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open a file in Builder

Status
Not open for further replies.

davidmelvin

Technical User
Nov 3, 2000
13
US
I need to open a text file, read it, modify it, then save and close it. All of this will work in the backgound. That is, no user interface. The user will click on a button and start a sequence of operations including the above mentioned.

How do I open, read, write, save, close this file? Which header files will I need?

Thank you,
David
 
Use fopen.
The syntax is like this.

FILE *fopen(const char *filename, const char *mode);

for mode use r to read a file, w to write a file.
 
Thank you brisko,

Which header file should I use for fopen?

David
 
You could also use iostream. Just depends on which you prefer.


James P. Cottingham

All opinions are mine alone and do not necessarily reflect those of my employer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top