Ecriture d'unfichier sur mbed pour sauvegarde de données
Fork of LocalFileSystem_HelloWorld by
Revision 1:a4757252e0ae, committed 2017-06-22
- Comitter:
- LouisReynier
- Date:
- Thu Jun 22 13:03:49 2017 +0000
- Parent:
- 0:cc465aef98cf
- Commit message:
- Exemple ?criture d'un fichier sur mbed
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r cc465aef98cf -r a4757252e0ae main.cpp --- a/main.cpp Wed Feb 13 16:36:26 2013 +0000 +++ b/main.cpp Thu Jun 22 13:03:49 2017 +0000 @@ -3,7 +3,12 @@ LocalFileSystem local("local"); // Create the local filesystem under the name "local" int main() { - FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing - fprintf(fp, "Hello World!"); + int tablo[6] = {4, 8,15, 16, 23, 46}; + int i = 0; + FILE *fp = fopen("/local/compil.txt", "w"); // Open "out.txt" on the local file system for writing + for (i =0; i<6; i++) + { + fprintf(fp, "%d \n", tablo[i]); + } fclose(fp); } \ No newline at end of file