C language appends content to the file

www.‮‬lautturi.com
C language appends content to the file

To append text to a file, you can use the a mode (append mode) while opening the file:

/*
Example: append new text to file in C language
*/

#include <stdio.h>
#include <stdlib.h>

int main() {

    FILE *filePointer = fopen("test.txt", "a");

    fputs("new added text", filePointer);
    
    fclose(filePointer);
    
    return 0;
}
Created Time:2017-08-22 14:03:22  Author:lautturi