Open with append:
pFile2 = fopen("myfile2.txt", "a");
then just write to pFile2
, no need to fseek()
.
More Related Contents:
- How can I get a text file into a string but whith the “\n” in C?
- Reading and analyzing rooms from text file
- Why is “while ( !feof (file) )” always wrong?
- How do you determine the size of a file in C?
- How can I get a file’s size in C? [duplicate]
- Retrieve filename from file descriptor in C
- How to truncate a file in C?
- Download file using libcurl in C/C++
- In C, how should I read a text file and print all strings
- __FILE__ macro shows full path
- While (( c = getc(file)) != EOF) loop won’t stop executing
- Why does stat fail using a name from readdir? [duplicate]
- What’s the best way to return a random line in a text file using C?
- Why is fseek or fflush always required between reading and writing in the update modes?
- What is the difference between read() and fread()?
- Using fseek with a file pointer that points to stdin
- How can I convert a file pointer ( FILE* fp ) to a file descriptor (int fd)?
- Read from file or stdin
- practical examples use dup or dup2
- C, reading from file into structure
- fcntl, lockf, which is better to use for file locking?
- Reading numbers from a text file into an array in C
- read file backwards (last line first)
- What exactly is the FILE keyword in C?
- How to buffer stdout in memory and write it from a dedicated thread
- How to skip a line when fscanning a text file?
- Reading one line at a time in C
- Does fread move the file pointer?
- How to read all files in a folder using C
- How to declare a structure in a header that is to be used by multiple files in c?