Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main(void)
  6. {
  7.  
  8.  FILE *fichier=fopen("/home/franck/Bureau/LangageC/Jeu_Du_Pendu/secret.hide", "r");
  9.  int taille_max =0;
  10.         int caractere=0;
  11.  int i=0;
  12.  
  13.  do
  14.  {
  15.   i+=1;
  16.   caractere=fgetc(fichier);
  17.  }while(caractere != EOF);
  18.  
  19.  // i-1 car j'ai le caractère � qui s'ajoute à chaque fois (\0 ??)
  20.  taille_max = i-1;
  21.  
  22.  printf("Taille : %d\n", taille_max);
  23.  
  24.  return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement