fputc(int c , FILE *fichier ): Ecrit un caractère dans la position actuelle du fichier

Author:


{filelink=13126}

/*
#include 
int fputc ( int c , FILE *fp  );

  */

  #include 
  #include 

  #define CYCLES 10000
  #define POINTS 4

  int main(void)
  {
    FILE *fp;

    if((fp=fopen("test.txt", "wb"))==NULL) {
      printf("Impossible d'ouvrir le fichier.");
      exit(1);
    }

 for (int count = 0; count < CYCLES; ++count)
  {
    if ( count % ( CYCLES / POINTS ) != 0) continue;
    fputc( '.', fp);
 }

    fclose(fp);

	return 0;
  }

Leave a Reply

Your email address will not be published. Required fields are marked *