Bonjour à tous!
Voila je vous explique rapidement mon petit problème:
Pour mon travail de fin d'étude je réalise un petit programme en C, pour l'instant juste en mode console. Je suis débutante en C, il s'agit la de mon premier programme. J'ai apprit le C grâce aux cours et tutoriels C et aussi la FAQ C. Il s'agit d'un petit répertoire qui doit permettre de rajouter et de faire une recherche de contact.
Voici pour l'instant mes pages:
Main
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 #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { printf("*** Bonjour, Que souhaitez vous faire? ***\n\n"); printf("*** Tapez 1 pour entrer un nouveau contact. *** \n*** Tapez 2 pour rechercher un contact deja existant. ***\n \n"); long choix = 0; scanf("%ld", &choix); while ( choix != 1 && choix != 2) { printf("*** Le nombre que vous avez rentre n'est pas valide. ***\n*** Veuillez faire un autre choix. ***\n\n"); scanf("%ld", &choix); } if (choix == 1) { printf("*** Vous avez choisi de rentrer un nouveau contact. ***\n\n"); entrerContact(choix); } else if (choix == 2) { printf("*** Vous avez choisi de rechercher un contact deja existant. ***\n\n"); rechercherContact(choix); } system("PAUSE"); return 0; }
ajouterContact.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 void entrerContact(char choix); void nom(char nomEntrer);
ajouterContact.c
pour l'instant ce sont les seules pages ayant du code.
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 #include <stdio.h> #include <stdlib.h> #include <string.h> #include "ajouterContact.h" void entrerContact(char choix) { char nomEntrer[50]; printf("***Quel est le nom de la personne que vous souhaitez ajouter?*** \n\n"); scanf("%s", nomEntrer); nom(nomEntrer); } void nom(long nomEntrer) { printf("***Vous avez inserer: %s, souhaitez vous corriger? (1 pour oui, 2 pour non.)***\n\n", nomEntrer); long choix = 0; scanf("%ld", &choix); while(choix != 1 && choix != 2) { printf("***Votre choix n'est pas valide, veuillez refaire un choix.\n\n***"); scanf("ld", &choix); } if(choix == 1) { printf("***vous avez choisi de rentrer un nouveau nom de contact.***\n\n"); scanf("%s",nomEntrer); printf("Vous avez ecrit: %s.\n \n", nomEntrer); } else if (choix == 2) { printf("***Vous avez choisi de laisser ce nom de contact la.***\n\n"); } }
Mais lorsque je compile il me donne ces différentes erreurs dans ajouterContact.c
J ai mit en rouge les lignes en questionligne 13:[Warning] passing arg 1 of `nom' makes integer from pointer without a cast (ajouterContact.c)
ligne 20 conflicting types for 'nom' (ajouterContact.c)
ligne 5 previous declaration of 'nom' was here (ajouterContact.h)
ligne 20 conflicting types for 'nom' (ajouterContact.c)
ligne 5 previous declaration of 'nom' was here (ajouterContact.h)
merci a tous d'avoir prit le temps ne serait ce de lire.
Bonne journée a tous !
Partager