Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1.  
  2. unsigned char *tab=(unsigned char*)malloc(MAX * sizeof(unsigned char));
  3.  
  4.  
  5. if(tab ==NULL){
  6.  
  7. fprintf(stderr, "Not enough memory !\n");
  8.  
  9.  
  10. return NULL;
  11. }
  12.  
  13.  
  14. if(fichier == NULL){
  15. fprintf(stderr, "Error, file missing\n");
  16. exit(1);
  17. }
  18.  
  19. else{
  20.  
  21. int c;
  22. int i=0;
  23.  
  24. while((c=fgetc(fichier))!=EOF){
  25. if(c!=' '){
  26.  
  27. tab[i]=c;
  28. printf("%c--",c);
  29. i++;
  30. }
  31. }
  32. }
  33.  
  34.  
  35.  
  36. return tab;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement