
See http://www.cplusplus.com/ref/cstdio/fopen.html for more on fopen and stdio.h
/*
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
fclose(file); /*done!*/
getchar(); /* pause and wait for key */
return 0;
}
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου