#include #include #include int main(int argc, char const *argv[]) { FILE *f; f=fopen("compteur.txt","r"); int n = 0; fread(&n,1,1,f); n++; f=fopen("compteur.txt","w"); fwrite(&n,1,1,f); fclose(f); printf("%d\n", n); return 0; }