Emmanuel Delahaye C is a sharp tool | KspR92 a écrit :
Code :
- typedef struct
- {
- char ext[20];
- int nb;
- }extension;
- void saisie_extension(FILE *log,[# ff0e00]extension *liste[][/#ff0e00],int *nb);
- void plus_frequente(int *nb,[# ff0000]extension *liste[][/#ff0000]);
- int main()
- {
- FILE* log=fopen("liste","r" );
- extension liste[8000];
- saisie_extension(log,[# ff0e00]&liste[/#ff0e00],&nb);
- plus_frequente(&nb,[# ff0000]&liste[/#ff0000]);
- fclose(log);
- system("PAUSE" );
- }
|
|
Faut pas peindre le code... après on passe des heures à gratter la peinture...
Par contre, il serait beaucoup plus utile de poster du code compilable...
Project : Forums
Compiler : GNU GCC Compiler (called directly)
Directory : C:\dev\forums\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.c
main.c:7: error: syntax error before '*' token
main.c:7: warning: function declaration isn't a prototype
main.c:11: warning: function declaration isn't a prototype
main.c: In function `main':
main.c:12: error: `FILE' undeclared (first use in this function)
main.c:12: error: (Each undeclared identifier is reported only once
main.c:12: error: for each function it appears in.)
main.c:12: error: `log' undeclared (first use in this function)
main.c:12: warning: implicit declaration of function `fopen'
main.c:14: error: `nb' undeclared (first use in this function)
main.c:15: warning: passing arg 2 of `plus_frequente' from incompatible pointer type
main.c:16: warning: implicit declaration of function `fclose'
main.c:17: warning: implicit declaration of function `system'
Process terminated with status 1 (0 minutes, 0 seconds)
6 errors, 6 warnings
|
Ce code
Code :
- #include <stdio.h>
- typedef struct
- {
- char ext[20];
- int nb;
- }
- extension;
- void saisie_extension (FILE * log, extension * liste[], int *nb);
- void plus_frequente (int *nb, extension * liste[]);
- int main (void)
- {
- FILE *log = fopen ("liste", "r" );
- extension liste[8000];
- saisie_extension (log, &liste, &nb);
- plus_frequente (&nb, &liste);
- fclose (log);
- system ("PAUSE" );
- }
|
est incomplet
Project : Forums
Compiler : GNU GCC Compiler (called directly)
Directory : C:\dev\forums\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.c
main.c: In function `main':
main.c:17: error: `nb' undeclared (first use in this function)
main.c:17: error: (Each undeclared identifier is reported only once
main.c:17: error: for each function it appears in.)
main.c:17: warning: passing arg 2 of `saisie_extension' from incompatible pointer type
main.c:18: warning: passing arg 2 of `plus_frequente' from incompatible pointer type
main.c:20: warning: implicit declaration of function `system'
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 3 warnings
|
Message édité par Emmanuel Delahaye le 05-01-2008 à 01:40:13 ---------------
Des infos sur la programmation et le langage C: http://www.bien-programmer.fr Pas de Wi-Fi à la maison : http://www.cpl-france.org/
|