J'ai écrit ce petit programme mais mon compilatur refuse de le compiler :
Il est censé prendre les 200 premiers caractères d'un fichier et les mettre dans un autre et ainsi de suite jusqu'à la fin du fichier.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 #include <stdio.h> int c=0 ; char path[50]= "*" ; char path2[50][100] ; char b[100][200], d, f, g, h , a ; FILE *fp, *fp2[100] ; main () { if ((fp=fopen (path, "r")) == NULL) { printf("Erreur1\n") ; exit(1) ; } while ((a = fget(fp)) != EOF) { gets (b[c], 200, fp) ; d= 97 ; d= f = g = h ; if (d != 122) d++ ; else { if (f=122) { if(g=122) ; { if(h=122) exit(1) ; }} else h++ ; else g++ ; else f++ ; } path2[c] = d ; path2[c] = f ; path2[c] = g ; path2[c] = h ; path2[c] = "*" ; if ((fp2[c] = fopen(path2[c], "w")) != NULL) { puts (b[c], 200, fp2[c]) ; close (fp2[c]) ; c++ ; } else { printf("Erreur2\n") ; exit(1) ; } close (fp) ; }
Merci d'avance !
PS: les * sont des adresses de fichiers que j'ai préféré retirer !
EDIT : désolé, j'ai oublié d'afficher les messages d'erreurs :
16 * too many arguments to function `gets'
32 * syntax error before "else"
37 * incompatible types in assignment
38 * incompatible types in assignment
39 * incompatible types in assignment
40 * incompatible types in assignment
41 * incompatible types in assignment
44 * too many arguments to function `puts'
55 * syntax error at end of input
Mon compilo est Dev-C++ !
Partager