Overwritten txt file in C

Asked

Viewed 359 times

4

My doubt is very basic:

How do I stop, whenever I write something in a file (txt), always start recording after the information that was already written there?

I mean, how do I not overwrite the contents of an archive that already had information inscribed?

Language C in the case

1 answer

7

Just open the file with fopen in the way append:

FILE *file = fopen("meuarquivo.txt", "a");
  • @Luigiwagner consider marking the answer as accepted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.