
TD
exercice1.cpp@0:85af55b43299, 2016-05-02 (annotated)
- Committer:
- jomfec
- Date:
- Mon May 02 09:06:17 2016 +0000
- Revision:
- 0:85af55b43299
INFO2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jomfec | 0:85af55b43299 | 1 | /*#include "mbed.h" |
jomfec | 0:85af55b43299 | 2 | Serial pc(USBTX,USBRX); |
jomfec | 0:85af55b43299 | 3 | LocalFileSystem local("local"); |
jomfec | 0:85af55b43299 | 4 | int donnee_a_ecrire; |
jomfec | 0:85af55b43299 | 5 | int donnee_lue; |
jomfec | 0:85af55b43299 | 6 | int main () |
jomfec | 0:85af55b43299 | 7 | { |
jomfec | 0:85af55b43299 | 8 | FILE* File1 = fopen("/local/datafile.txt","w"); |
jomfec | 0:85af55b43299 | 9 | donnee_a_ecrire =0x61; // ASCII caractere "a" |
jomfec | 0:85af55b43299 | 10 | fputc(donnee_a_ecrire, File1); |
jomfec | 0:85af55b43299 | 11 | fclose(File1); |
jomfec | 0:85af55b43299 | 12 | FILE* File2 = fopen ("/local/datafile.txt","r"); |
jomfec | 0:85af55b43299 | 13 | donnee_lue = fgetc(File2); |
jomfec | 0:85af55b43299 | 14 | fclose(File2); |
jomfec | 0:85af55b43299 | 15 | pc.printf("input value = %c \n", donnee_lue); |
jomfec | 0:85af55b43299 | 16 | } |
jomfec | 0:85af55b43299 | 17 | */ |