User forums > Using Code::Blocks

Write in file without deleting its contents


Hello again,

I have stored some numbers in a text file and I want to read these numbers when starting my program. As far as I know, if I want to use a file in my program, I need to use fopen("file.txt", "w"), which clears the contents of the file. Is there a way to read and write a file without having to delete what's in it first, so that I can use the file to store long term information?

next time, use a general programming forum, not this one !
For example have a look in

Sorry, I didn't know this was only for Codeblocks questions. I think I found an answer to my problem, thanks!


[0] Message Index

Go to full version