Created
August 27, 2012 08:58
-
-
Save linuxaged/3486773 to your computer and use it in GitHub Desktop.
open file and write in c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Open_file_and_write.c | |
Date: 02/01/05 | |
Description: Opens file by append example. | |
*/ | |
#include <stdio.h> | |
int main() | |
{ | |
FILE *file; | |
file = fopen("file.txt","a+"); /* apend file (add text to | |
a file or create a file if it does not exist.*/ | |
fprintf(file,"%s","This is just an example :)"); /*writes*/ | |
fclose(file); /*done!*/ | |
getchar(); /* pause and wait for key */ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment