IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C Discussion :

erreur a la compilation - C


Sujet :

C

  1. #1
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut erreur a la compilation - C
    bonjour je fait un prg en langage c et lorsque je veux compilé mes fichiers il me repond certaines erreurs dont la plus fréquente :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    libbc.c(12,11): Call to function 'ecran' with no prototype
    elle apparait plus fois et donc mon compilateur ne veut plus executer mon prg pour cause trop de "WARNINGs"

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    libbc.c(894,44) : Too manuy error or warning messages
    sachant que j'ai un fichier avec mon main, un autre libb.h avec les prototype et un autre libb.c avec les fonctions donc j'en ai trois. donc je pense avoir fait le necessaires pour eviter ces désagrément. merci de m'éclairer car je dois le rendre pour ce lundi et mon compilateur c'est borland c++ 5.?

  2. #2
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par M.a.n.u.
    bonjour je fait un prg en langage c et lorsque je veux compilé mes fichiers il me repond certaines erreurs dont la plus fréquente :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    libbc.c(12,11): Call to function 'ecran' with no prototype
    elle apparait plus fois et donc mon compilateur ne veut plus executer mon prg pour cause trop de "WARNINGs"

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    libbc.c(894,44) : Too manuy error or warning messages
    sachant que j'ai un fichier avec mon main, un autre libb.h avec les prototype et un autre libb.c avec les fonctions donc j'en ai trois. donc je pense avoir fait le necessaires pour eviter ces désagrément. merci de m'éclairer car je dois le rendre pour ce lundi et mon compilateur c'est borland c++ 5.?
    Il faut corriger ton code.

    Je rappelle que pour appeler une fonction, il faut définir son prototype avant. En principe, celui-ci est placé dans un header si la fonction est externe.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    #include "g.h"
     
    f()
    {
       g();
    }
    Si elle est interne, le plus souvent, un simple réarrangement des fonctions (la plus 'profonde' en haut, la plus haute en bas) suffit :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    h()
    {
    }
     
    g()
    {
       h();
    }
     
    f()
    {
       g();
    }
    En cas de problèmes, poste ton code ou fait un zip et poste une url.

  3. #3
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    je viens de changer l'extension de mes fichiers car avant c'était des f.c maintenant ce sont des f.cpp

    normalement je n'ai plus ces erreurs la et merci pour la rapidité de la réponse c'est super cool !

  4. #4
    Expert éminent sénior
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Points : 13 380
    Points
    13 380
    Par défaut
    Citation Envoyé par M.a.n.u.
    je viens de changer l'extension de mes fichiers car avant c'était des f.c maintenant ce sont des f.cpp

    normalement je n'ai plus ces erreurs la et merci pour la rapidité de la réponse c'est super cool !
    Si tu fais du C les extensions sont .c c'est tout.

    On ne supprime pas un warning comme ça on cherche d'où ça vient et on répare.

    Donc comment compiles-tu ? En C ou C++ ?

  5. #5
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par M.a.n.u.
    je viens de changer l'extension de mes fichiers car avant c'était des f.c maintenant ce sont des f.cpp
    Ah ? Il y a donc de fortes chances que tu compiles maintenant en C++. Ca risque de changer la sémantique de ton code (si ça compile), car ce sont 2 langages différents.

  6. #6
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    mon code :
    /**CAR.C**/

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
     
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    #include "structs.c"
    #include "libb.c"
    #define KEY_DOWN 80
    #define KEY_UP 72
    /******************************************************************************/
    void main()
    {
    	textmode(C4350);
       textbackground(7);
       clrscr();
       menu_principal();
    }
     
    void menu_principal()
    {
    	char vec[6][11]={"Car Search","Clients","Parc Auto","Equipier","Facture","Quitter"};
    	int n=6, rep;
       int l=11;
       int PosX=5,PosY=42;
     
       do
       {
       	clrscr();
          rep=deroulant(&vec[0][0],l,PosX,PosY,n);
       	switch(rep)
       	{
       		case 0 : clrscr();
             			car_search();
             			break;  //rechercher une auto
     
          	case 1 : clrscr();
             			client();
                      break;  //operation sur client
     
          	case 2 : clrscr();
          				parc_auto();
                   	break;  //operation sur les autos.
     
          	case 3 : clrscr();
             			equipier();
                   	break;  //operation sur les vendeurs
     
          	case 4 : break;  //operation sur les options (indeterminé)
     
          	case 5 : break;  //quitter
       	}
       }
       while(rep!=5);
    }//pas de prob !
    /******************************************************************************/
    void parc_auto()
    {
    	int i,j;
       int rslt;  //var qui accueillera le rslt du menu deroulant.
       int l=11; //longueur de la plus longue chaine
       int PosX=4,PosY=44;   //le positionnement du menu deroulant
       int n=4; //nbre de chaine
       char fichier[9]={"auto.dat"};
       char index[15]={"index_auto.dat"};
       char fichier_temporaire[10]={"auto2.dat"};
       char vec[4][11]={"Visualiser","Ajouter","Modifier","Retour"};
       do
       {
          clrscr();
          ecran();
       	gotoxy(4,4);
          textcolor(0);cprintf(" P A R C   A U T O");
          gotoxy(2,6);cprintf("%c",204);
          for(i=3,j=6;i<79;i++)
          {
          	gotoxy(i,j);cprintf("%c",205);
          }
          gotoxy(i,j);cprintf("%c",185);
       	rslt=deroulant(&vec[0][0],l,PosX,PosY,n);
       	switch(rslt)
       	{
       		case 0 :
             			clrscr();
             			visualiser(&index[0],9);
             			break;
     
          	case 1 :
          				clrscr();
                      ajout_auto(&fichier[0]);
                      creation_index_auto(&fichier[0],&index[0]);
                      //renommer les fichier ici ?
                      break; //ajout
     
          	case 2 : clrscr();
             			modif_auto(&fichier[0],&fichier_temporaire[0]);
                      creation_index_auto(&fichier[0],&index[0]);
                      //renommer les fichier ici ?
          				break; //modif
     
          	case 3 :
          				break; //retour
    		}
       }
       while(rslt!=3);
    }
    /******************************************************************************/
    void client()
    {
    	int rslt=0;  //var qui accueillera le rslt du menu deroulant.
       int l=11; //longueur de la plus longue chaine
       int PosX=2,PosY=44;   //le positionnement du menu deroulant
       int n=4;
       char fichier[11]={"client.dat"};
       char index[17]={"index_client.dat"};
       char new_name[]={"indextrieclient.dat"},ancien_name[]={"index_client.dat"};
       char vec[4][11]={"Rechercher","Ajout","Suppr","Retour"};
       do
       {
     
       	rslt=deroulant(&vec[0][0],l,PosX,PosY,n);
       	switch(rslt)
       	{
       		case 0 : ecran(); //je fait la gestion pour rechercher mtn
             			ax_dir_client(&fichier[0],&index[0]);
             			creation_index_client(&fichier[0],&index[0]);
                      trier_index_client(&index[0]);
                      renomfich(new_name,ancien_name);
             			break; //rechercher un client et eventuellement modifier ou supprimer le rec
     
       		case 1 : ajout_client(&fichier[0]);
             			creation_index_client(&fichier[0],&index[0]);
                      trier_index_client(&index[0]);
                      renomfich(new_name,ancien_name);
       					break;  //ajouter un client
     
       		case 2 : clrscr();
             			suppr_client("client.dat");
                      creation_index_client(&fichier[0],&index[0]);
                      trier_index_client(&index[0]);
                      renomfich(new_name,ancien_name);
             			break;//suppression client
             case 3 :
             			break;                 //retour
       	}
       }
       while(rslt!=3);
    }
    /******************************************************************************/
    void equipier()
    {
    	int rslt=0;  //var qui accueillera le rslt du menu deroulant.
       int l=9; //longueur de la plus longue chaine
       int PosX=2,PosY=44;   //le positionnement du menu deroulant
       int n=3;
       char fichier[13]={"equipier.dat"};
       char vec[3][9]={"Ajout","Modifier","Retour"};
       do
       {
       	printf("\n equipier :");
       	rslt=deroulant(&vec[0][0],l,PosX,PosY,n);
       	switch(rslt)
       	{
       		case 0 : ajout_equipier(&fichier[0]);
             			break;
     
       		case 1 : modifier_equipier();
       					break;
     
       		case 2 :
             			break;
       	}
       }
       while(rslt!=2);
    }
    /******************************************************************************/
    int deroulant(char* tab,int c,int col,int lig,int n)
    {
    	int ancpos, anci,pos,i,touche,max=n;//max=nbre d'element
    	_setcursortype(_NOCURSOR);
     
     
    	for(i=0;i<max;i++)
    	{
    		gotoxy(col,lig+i);
    		textcolor(0);cprintf("%s\n",(tab+i*c));
    	}
    	pos=lig;i=0;
    	do
    	{
       	if(strcmp(tab,"Car Search")==0)
          {
          	Logo();Cadre_Logo();Cadre_Deroulant();
          }
          else if (strcmp(tab,"Rechercher")==0)
          {
          	Logo();Cadre_Logo();
          }
    		gotoxy(col,pos);textcolor(2);
    		cprintf("%s",(tab+i*c)); textcolor(0);
    		touche=getch();
    		ancpos=pos;
    		anci=i;
    		if(touche==0)
          {
          	touche=getch();
    			if(touche==KEY_DOWN)
    			{
    				if(i==max-1)
    				{
    					pos=lig;
    					i=0;
    				}
    				else
    				{
    					++pos;
    					++i;
    				}
    			}
       		if(touche==KEY_UP)
       		{
        			if(i==0)
        			{
         				pos=lig+(n-1);
         				i=max-1;
        			}
        			else
        			{
         				--pos;
         				--i;
        			}
       		}// fin if touche KEY_UP
       		gotoxy(col,ancpos);
       		textbackground(7);
       		cprintf("%s",(tab+anci*c));
      		}
     	}
       while(touche != 13);
       _setcursortype(_NORMALCURSOR);
     	return i;
    }

  7. #7
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    /**STRUCTS.C**/ contient mes structures

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    struct equipe
    {
    	char c_Nom[30];
       char c_Prenom[30];
       //char c_Sex;
       char c_Pass[11];
       int i_NbVehiVendu;
       char c_Rue[30]; //av bld ch
       short s_Num;
       short s_Bte;
       short s_CodePost;
       char c_Ville[30];
       char c_Tel[14]; // xxxxx064898990
       char c_Email[30];
    };
     
    struct car
    {
    	//char c_Dos[10];
    	char c_Marque[30];
    	char c_Model[30];
    	char c_Chassis[20];//(2-3 p, 4-5 p, 4x4, autres, break, cabriolet, coupe, monovolume, utilitaire)
    	char c_Couleur[20];
    	char c_Transmission[15];//(auto,manu)
    	char c_Carburant[15]; //(essence, diesel, electrique, hydrogène, lpg, ethanol
    	short s_Kw;
    	short s_Cv;
    	short s_Cc;
    	char c_Mise_En_Circulation[11]; // xx/xx/xxxx
    	char c_KiloMetrage[7]; //100 000
    	float f_Prx;
    	char c_Prem_Prop; //o ou n
    	char c_Carte_Grise; // o ou n
    	char c_Carte_Conform; // o ou n
    	char c_Contr_tech; // o ou n
    	char c_Carnet_Constructeur; //o ou n
    	char c_Bte_Secu; //o ou n
    	char c_Roue_Sec; //o ou n
    	char c_Triang; //o ou n
    	char c_Car_Pass; //o n
    	char c_Conform_handi; //o ou n
    	char c_Air_Bag; //o ou n
    	char c_Clim; //o ou n
    	char c_Note[200]; /* nota bene sur le vehicule*/
    };
     
    struct index_car
    {
    	short s_No;
    	char c_Marque[30];
       char c_Model[30];
       char c_Chassis[20];
       char c_Couleur[20];
       char c_Carburant[15];
       float f_Prx;
    };
     
    struct client
    {
    	char c_Nom[30];
    	char c_Prenom[30];
       //char c_Sex;
    	char c_Rue[30];
    	short s_Num;
    	short s_Bte;
    	short s_CodePost;
    	char c_Ville[30];
    	char c_Tel[14];
    };
     
    struct index_client
    {
    	short s_No;
       char c_Nom[30];
       char c_Prenom[30];
       //char c_Sex;
       char c_Tel[30];
    };
    struct e
    {
    	char c_Rue[30];
       short s_Num;
       short s_Bte;
       short s_CodePost;
       char c_Ville[30];
       char c_NoTva[22];
       char c_Tel[];
       char c_Fax[];
       char c_Web[];
    };

  8. #8
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    /**LIBB.H**/ contient les prototypes

    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
    56
    57
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    #include "libb.c"
    void entete_parc_auto();
    void car_search();
    void equipier();
    void parc_auto();
    void client();
    void menu_principal();
    void Cadre_Deroulant();
    void ecran();
    void Cadre_Logo();
    void Logo();
    void modifier_equipier();
    void ajout_equipier();
    void ajout_pass(char*,int,char*,int,int);
    void ajout_mail(char*,int,char*,int,int);
    void creation_index_client(char*,char*);
    void renomfich(char*,char*);
    void trier_index_client(char*);
    void ax_dir_client(char*,char*);
    void suppr_client(char*);
    void ajout_client(char*);
    void ajout_nom(char*,int,char*,int,int);
    void ajout_prenom(char*,int,char*,int,int);
    void ajout_rue(char*,int,char*,int,int);
    void ajout_num(short*,int,char*,int,int);
    void ajout_numbte(short*,int,char*,int,int);
    void ajout_cp(short*,int,char*,int,int);
    void ajout_ville(char*,int,char*,int,int);
    void ajout_tel(char*,int,char*,int,int);
    void ajout_auto(char*);
    void saisie(char*,char*,int,int,int);
    void ajout_marque_auto(struct car*,char*,int,int);
    void ajout_model_auto(struct car*,char*,int,int);
    void ajout_chassis_auto(struct car*,char*,int,int);
    void ajout_couleur_auto(struct car*,char*,int,int);
    void ajout_transmi_auto(struct car*,char*,int,int);
    void ajout_carbu_auto(struct car*,char*,int,int);
    void ajout_kw_auto(struct car*,char*,int,int);
    void ajout_cv_auto(struct car*,char*,int,int);
    void ajout_cc_auto(struct car*,char*,int,int);
    void ajout_mise_en_circulation_auto(struct car*,char*,int,int);
    void ajout_kilometrage_auto(struct car*,char*,int,int);
    void ajout_prx_auto(struct car*,char*,int,int);
    char choixon(char*,char*,int,int);
    void ajout_nb_auto(struct car*,char*,int,int);
    void modif_auto(char*,char*);
    void visualiser(char*,int);
    void creation_index_auto(char*,char*);
    void pied_parc_auto(int);
    int aff_det(int);
    void fus_auto(int,char*);
    void aff_auto(struct car*,int,int);

  9. #9
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    /**LIBB.C**/ contient les fonctions
    partie 1

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
     
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    #include "libb.h"
    void Cadre_Deroulant()
    {
       int i,j;//cadre pour le menu deroulant principal
       textbackground(7);textcolor(0);
       gotoxy(3,40);cprintf("%c",201); //csg
       gotoxy(16,40);cprintf("%c",187);     //csd
       gotoxy(3,49);cprintf("%c",200);          //cig
       gotoxy(16,49);cprintf("%c",188);               //cid
       for(i=4, j=40 ; i<16;i++)  //lig verti sup
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       for(i=4 , j=49 ; i<16;i++) //lig verti inf
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       for(i=3,j=41;j<49;j++)//lig verti de gauche
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
     
       for(i=16,j=41;j<49;j++)//lig verti de droite
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
    }
    void Cadre_Logo()
    {
    	int i,j;
       gotoxy(3,9);cprintf("%c",201);
    	for(i=4,j=9;i<78;i++)
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i,j);cprintf("%c",187);
     
    	for(i=78,j=10;j<22;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",188);
     
       for(i=4,j=22;i<78;i++)
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       for(i=3,j=10;j<22;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
    }
    void Logo()
    {
       int PosX=5, PosY=10;
       int i,j;
       int LongBrancHoriSupDuC=10;
       int LongBrancVertDuC=10;
     
       /*for(i=1,j=10;i<PosX;i++)
       {
       	gotoxy(i,j);cprintf("*");
       }
       for(i=80,j=16;i>76;i--)
       {
       	gotoxy(i,j);cprintf("*");
       } */
     
       //grand C
       gotoxy(PosX,PosY);cprintf("%c",201);
       for(i=PosX+1;i<PosX+LongBrancHoriSupDuC+1;i++)  //i<PosX+35+1 correspond a la longueur des branches horiz sup du c
       {
       	gotoxy(i,PosY);cprintf("%c",205);
       }
       gotoxy(i,PosY);cprintf("%c",187);
     
       for(i=PosX,j=PosY+1;j<PosY+LongBrancVertDuC+1;j++) //j<PosY+20+1 correspond a la branche vertical du c
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
     
       for(i=PosX+1,j=PosY+10+1;i<PosX+10+1;i++) // j<PosY+20+1 idem que celui de l'autre for && i<PosX+35+1 correspond a la longueur des branches horiz inf du c
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i,j);cprintf("%c",188);
     
       //ptit C
       PosX=PosX+15;
       PosY=PosY+3;
       LongBrancVertDuC=7; //il faut la modifier pour ajuster le ptit c par rapport au Grd
       gotoxy(PosX,PosY);cprintf("%c",201);
       for(i=PosX+1;i<PosX+LongBrancHoriSupDuC+1;i++)
       {
       	gotoxy(i,PosY);cprintf("%c",205);
       }
       gotoxy(i,PosY);cprintf("%c",187);
     
       for(i=PosX,j=PosY+1; j<PosY+LongBrancVertDuC+1;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
     
       for( i=PosX+1 , j=PosY+LongBrancVertDuC+1 ; i<PosX+LongBrancHoriSupDuC+1 ; i++ )
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i,j);cprintf("%c",188);
     
       //c
       PosX=PosX+15;
       PosY=PosY+3;
       LongBrancVertDuC=4;
       gotoxy(PosX,PosY);cprintf("%c",201);
     
    	for(i=PosX+1 ; i<PosX+LongBrancHoriSupDuC+1 ;i++)
       {
       	gotoxy(i,PosY);cprintf("%c",205);
       }
       gotoxy(i,PosY);cprintf("%c",187);
     
       for(i=PosX,j=PosY+1 ; j<PosY+LongBrancVertDuC+1;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
     
       for( i=PosX+1 , j=PosY+LongBrancVertDuC+1 ; i<PosX+LongBrancHoriSupDuC+1 ; i++ )
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i,j);cprintf("%c",188);
     
       //a de car
       PosX=PosX+15;
       //PosY=PosY+3;
       gotoxy(PosX,PosY);cprintf("%c",201);
       for(i=PosX+1;i<PosX+LongBrancHoriSupDuC+1;i++)
       {
       	gotoxy(i,PosY);cprintf("%c",205);
       }
       gotoxy(i,PosY);cprintf("%c",187);
     
       for(i=PosX,j=PosY+1; j<PosY+LongBrancVertDuC+1;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
     
       for(i=PosX+LongBrancHoriSupDuC+1,j=PosY+1; j<PosY+LongBrancVertDuC+1;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",202);
     
       for( i=PosX+1 , j=PosY+LongBrancVertDuC+1 ; i<PosX+LongBrancHoriSupDuC+1 ; i++ )
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i+1,j);cprintf("%c",205);
     
       //r de car
       PosX=PosX+15;
       gotoxy(PosX,PosY);
       gotoxy(PosX,PosY);cprintf("%c",201);
       for(i=PosX+1;i<PosX+LongBrancHoriSupDuC+1;i++)
       {
       	gotoxy(i,PosY);cprintf("%c",205);
       }
       gotoxy(i,PosY);cprintf("%c",187);
     
        for(i=PosX,j=PosY+1; j<PosY+LongBrancVertDuC+1;j++)
       {
       	gotoxy(i,j);cprintf("%c",186);
       }
        gotoxy(i,j);cprintf("%c",202);
    }
    /******************************************************************************/
    void modifier_equipier()
    {
    	char fichier1[]={"equipe.dat"};
       char fichier2[]={"equipe2.dat"};
       char choix;
       char auto_lettre[53]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."};
       char autor[69]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@_-&|.,"};
       char autor2[]={"oOnN"};
       char num[11]={"0123456789."};
    	struct equipe d;
       char ch[30];
       int i=0;
       short s;
    	FILE *f1, *f2;
       f1=fopen(fichier1,"rb");
       f2=fopen(fichier2,"wb");
       if(f1!=NULL && f2!=NULL)
       {
       	fread(&d,sizeof(struct equipe),1,f1);
          while(!feof(f1))
          {
          	clrscr();
          	printf("\n rec n%d :\n",i+1);
             printf("\n NOM : %s",d.c_Nom);
             printf("\n PRENOM : %s",d.c_Prenom);
             printf("\n PASSWORD : %s",d.c_Pass);
             printf("\n NOMBRE DE VEHICULE VENDU : %d",d.i_NbVehiVendu);
             if(d.s_Bte==0)
             {
             	printf("\n ADRESSE : %s, %ld",d.c_Rue,d.s_Num);
             }
             else
             {
             	printf("\n ADRESSE : %s, %ld BTE %ld",d.c_Rue,d.s_Num,d.s_Bte);
             }
             printf("\n LOCALITE : %ld %s",d.s_CodePost,d.c_Ville);
             printf("\n TELEPHONE : %s",d.c_Tel);
             printf("\n EMAIL : %s",d.c_Email);
             choix=choixon("voulez-vous supprimer le record (o/n) ?",&autor2[0],42, 13);
             if(choix=='n'||choix=='N')
             {
     
             	choix=choixon("voulez-vous modifier le record (o/n) ?",&autor2[0],41 ,15 );
             	if(choix=='o'||choix=='O')
             	{
             		//modification des champs
                	//modification de tous les champs directement
                	clrscr();
                	choix=choixon("voulez-vous modifier le nom (o/n) ?",&autor2[0],38 ,3);
                	if(choix=='o'||choix=='O')
                	{
                		ajout_nom(&ch[0],30,&auto_lettre[0],8,5);
                      	strcpy(d.c_Nom,ch);
                	}
                	clrscr();
                	choix=choixon("voulez-vous modifier le prenom (o/n) ?",&autor2[0],41 ,3);
                	if(choix=='o'||choix=='O')
                	{
                		ajout_prenom(&ch[0],30,&auto_lettre[0],11,5);
                      	strcpy(d.c_Prenom,ch);
                	}
                	clrscr();
             		choix=choixon("voulez-vous modifier le pass (o/n) ?",&autor2[0],39 ,3);
       				if(choix=='o'||choix=='O')
                	{
                		ajout_pass(&ch[0],5,&autor[0],13,5);
                      	strcpy(d.c_Pass,ch);
                	}
          			//d.i_NbVehiVendu=0; ne pas modif ce champ
     
                	clrscr();
             		choix=choixon("voulez-vous modifier l adresse (o/n) ?",&autor2[0],41 ,3);
    					if(choix=='o'||choix=='O')
                	{
                		ajout_rue(&ch[0],30,&autor[0],8,5); //lors de l'affichage il affiche que "rue" c tout !!!
                   		strcpy(d.c_Rue,ch);
                	}
                   clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
                   	ajout_num(&s,7,&num[0],11,10);
                      	d.s_Num=s;
     
       				}
                   clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
                   	ajout_numbte(&s,5,&autor[0],12,12);
                      	d.s_Bte=s;
       				}
                   clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
                   	ajout_cp(&s,6,&num[0],16,14);
                      	d.s_CodePost=s;
                   }
       				clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
                   	ajout_ville(&ch[0],30,&auto_lettre[0],10,16);
                      	strcpy(d.c_Ville,ch);
     
                   }
                   clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
       					ajout_tel(&ch[0],14,&num[0],18,18);
                      	strcpy(d.c_Tel,ch);
                   }
       				clrscr();
             		choix=choixon("voulez-vous modifier le num (o/n) ?",&autor2[0],38,3);
       				if(choix=='o'||choix=='O')
                	{
                   	ajout_mail(&ch[0],30,&autor[0],11,20);
                      	strcpy(d.c_Email,ch);
                   }
             		fwrite(&d,sizeof(d),1,f2);
             	}
             	else
             	{
             		fwrite(&d,sizeof(d),1,f2);
             	}
             }
             i++;
             fread(&d, sizeof(struct equipe),1,f1);
          }
       }
       else
       {
       	printf("\n fichier innexistant");
       }
       fclose(f1);
       fclose(f2);
       renomfich(fichier2,fichier1);
       //remove(fichier1);
       //rename(fichier2,fichier1);
       //getch();
    }
    /******************************************************************************/
    void ajout_equipier()
    {
    	struct equipe d;
       char auto_lettre[53]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."};
       char autor[70]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@_-&|., "};
       char autor2[]={"oOnN"};
       char num[11]={"0123456789."};
       char rep;
       short s;
       char ch[30];
       FILE *f;
       f=fopen("equipe.dat","a+b");
       do
       {
       	clrscr();
    		ajout_nom(&ch[0],30,&auto_lettre[0],8 ,2);
          	strcpy(d.c_Nom,ch);
       	ajout_prenom(&ch[0],30,&auto_lettre[0],11,4);
          	strcpy(d.c_Prenom,ch);
       	ajout_pass(&ch[0],5,&autor[0],13,6);
          	strcpy(d.c_Pass,ch);
          d.i_NbVehiVendu=0;
       	ajout_rue(&ch[0],30,&autor[0],8,8); //lors de l'affichage il affiche que "rue" c tout !!!
          	strcpy(d.c_Rue,ch);
       	ajout_num(&s,7,&num[0],11,10);
          	d.s_Num=s;
       	ajout_numbte(&s,5,&autor[0],12,12);
          	d.s_Bte=s;
       	ajout_cp(&s,6,&num[0],16,14);
          	d.s_CodePost=s;
       	ajout_ville(&ch[0],30,&auto_lettre[0],10,16);
          	strcpy(d.c_Ville,ch);
       	ajout_tel(&ch[0],14,&num[0],18,18);
          	strcpy(d.c_Tel,ch);
       	ajout_mail(&ch[0],30,&autor[0],11,20);
          	strcpy(d.c_Email,ch);
       	//f=fopen("equipe.dat","ab");
       	fwrite(&d,sizeof(struct equipe),1,f);
     
          rep=choixon("voulez-vous ajouter un autre equipier (o/n) ?",&autor2[0],48,22); //ligne PosX, colone PosY
     
       }
       while(rep=='o');
       fclose(f);//getch();
    }
    /******************************************************************************/
    //lon vaudra 11 desormais c 5
    void ajout_pass(char* chaine,int lon,char* autor, int PosX, int PosY)
    {
    	//char chaine[11];
       printf("\n\n PASSWORD : ");
       saisie(chaine,autor,lon,PosX,PosY);
       //strcpy(d->c_Pass,chaine);
    }
    /******************************************************************************/
    //lon vaudra 30
    void ajout_mail(char* chaine,int lon,char* autor,int PosX,int PosY)
    {
    	//char chaine[30];
       printf("\n\n E-MAIL : ");
       saisie(chaine,autor,lon,PosX,PosY);
    }
    /*****************************************/
    //fct de client
    /******************************************************************************/
    void creation_index_client(char* fichier, char* index)
    {
    	int flag=0,i=0,j,x ;
    	struct client d;
    	struct index_client *dyn=NULL;
       FILE *f1, *f2;
       f1=fopen(fichier,"rb");
       if(f1!=NULL)
       {
       	fread(&d,sizeof(struct client),1,f1);
       	while(!feof(f1) && flag==0)
          {
          	dyn=(struct client*)realloc(dyn,(i+1)*sizeof(struct client));
             if(dyn==NULL)
             {
             	flag=1;
                printf("\n allocation dynamique impossible veuillez quitter les autres applications.");
             }
             else
             {
             	//printf("\n durant l alloc");
                dyn[i].s_No=i;
                strcpy(dyn[i].c_Nom,d.c_Nom);
                strcpy(dyn[i].c_Prenom,d.c_Prenom);
                strcpy(dyn[i].c_Tel,d.c_Tel);
                i++;
             }
             fread(&d,sizeof(struct client),1,f1);
          }
     
          //printf("\n affichage du fichier apres l alloc dyn .. val de i = %d :\n",i);
          // for(j=0;j<i;j++)
          //{
          	//printf("\n rec no %2ld, nom : %-10s, prenom : %-10s, numtel : %-15s",dyn[j].s_No,dyn[j].c_Nom,dyn[j].c_Prenom,dyn[j].c_Tel);
          //}//si j'enleve ceci il y a une erreur
     
          f2=fopen(index,"wb");
          if(f2!=NULL)
          {
     
          	//printf("\n\n ecriture dans l index :\n");
          	for(j=0;j<i;j++)
             {
                fwrite(&dyn[j],sizeof(dyn[j]),1,f2);
                //printf("\n val de retour de fwrite  %d pour le %d rec.",x,j);
             }
          }
          fclose(f2);
       }
       fclose(f1);
    }
    /******************************************************************************/
    void renomfich(char* new_name, char* ancien_name)
    {
    	remove(ancien_name); //on efface
       rename(new_name,ancien_name); //on renome le nouveau fichier avec le nom de l'ancien pour tous remettre dans l'ordre
    }
    /******************************************************************************/
    void trier_index_client(char *index)
    {
    	struct index_client d;
       struct index_client *dyn=NULL;
       char index_trie[]={"indextrieclient.dat"};
       FILE *f1,*f2;
       int i=0,k,j,flag=0;
    	f1=fopen(index,"r+b");
     
       if(f1==NULL)//on lit l index et on l'amène dans un vecteur dynamique
       {
       	printf("\n fichier inexistant");
       }
       else
       {
     
          fread(&d,sizeof(struct index_client),1,f1);
          while(flag==0 && !feof(f1))
          {
          	dyn=(struct index_client*)realloc(dyn,(i+1)*sizeof(struct index_client));
             if(dyn==NULL)
             {
             	flag=1;
                printf("\n allocation impossible veuillez quitter les autres applications.");
             }
             else
             {
             	dyn[i]=d;
                i++;
             }
          	fread(&d,sizeof(struct index_client),1,f1);
          }
          flag=0;
          //trie l index
          k=i-1;
          while(k>=0 && flag==0)
          {
          	flag=1;
             for(j=0;j<k;j++)
             {
             	if(strcmpi(dyn[j].c_Nom,dyn[j+1].c_Nom)>0)
                {
                	flag=0;
                   d=dyn[j];dyn[j]=dyn[j+1];dyn[j+1]=d;
                }
                else if(strcmpi(dyn[j].c_Nom,dyn[j+1].c_Nom)==0 && strcmpi(dyn[j].c_Prenom,dyn[j+1].c_Prenom)>0 )
                {
                	flag=0;
     
                      strcpy(d.c_Prenom,dyn[j].c_Prenom);
                      strcpy(dyn[j].c_Prenom,dyn[j+1].c_Prenom);
                      strcpy(dyn[j+1].c_Prenom,d.c_Prenom);
     
                      strcpy(d.c_Tel,dyn[j].c_Tel);
                      strcpy(dyn[j].c_Tel,dyn[j+1].c_Tel);
                      strcpy(dyn[j+1].c_Tel,d.c_Tel);
     
                }
                else if(strcmpi(dyn[j].c_Nom,dyn[j+1].c_Nom)==0 && strcmpi(dyn[j].c_Prenom,dyn[j+1].c_Prenom)==0 && strcmpi(dyn[j].c_Tel,dyn[j+1].c_Tel)>0 )
                {
                   	flag=0;
     
                      strcpy(d.c_Tel,dyn[j].c_Tel);
                      strcpy(dyn[j].c_Tel,dyn[j+1].c_Tel);
                      strcpy(dyn[j+1].c_Tel,d.c_Tel);
                }
             }
             k--;
          }
    		f2=fopen(index_trie,"wb");
          if(f2!=NULL)
          {
          		printf("\n ecrit et fin trie");
                for(j=0;j<i;j++)
                {
                	d=dyn[j];
                	fwrite(&d,sizeof(d),1,f2);
                   //printf("\n rec no %2ld, nom : %-10s, prenom : %-10s, numtel : %-15s",dyn[j].s_No,dyn[j].c_Nom,dyn[j].c_Prenom,dyn[j].c_Tel);
                }
          }
          fclose(f2);
       }
       fclose(f1);
    }
    /******************************************************************************/
    void ax_dir_client(char* index, char* fichier)
    {
    	struct index_client z[200];
       struct client d2;
       char rep;
       char ch[30];
       char ch2[14];
       short s;
       char aut[]={"onON"};
       char num[11]={"0123456789."};
       char auto_lettre[53]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."};
       int i,j,flag,n,p;
       long pos;
       FILE *f1,*f2;
       char Nom[30],Prenom[30];
       f1=fopen("index_client.dat","rb");
       if(f1==NULL)
       {
       	printf("\n fichier inexistant");
       }
       else
       {
       	i=0;
       	fread(&z[i],sizeof(struct index_client),1,f1);
          while(!feof(f1))
          {
          	i++;
             fread(&z[i],sizeof(struct index_client),1,f1);
          }
          //recherche
          printf("N O M : ");
          ajout_nom(&Nom[0],30,&auto_lettre[0],10,10);
          printf("\n entre le prenom a rechercher : ");
          ajout_prenom(&Prenom[0],30,&auto_lettre[0],10,11);
     
          j=flag=0;
          while(flag==0 && j<i)
          {
          	if(strcmpi(z[j].c_Nom,Nom)==0 && strcmpi(z[j].c_Prenom,Prenom)==0)
             {
                flag=1;
                p=z[j].s_No;
             }
             j++;
          }
          if(flag==1)
          {
          	//Ax direct
             f2=fopen("client.dat","r+b");
             if(f2==NULL)
             {
             	printf("\n fichier inexistant");
             }
             else
             {
             	fseek(f2,p*sizeof(struct client),1);
                pos=ftell(f2);
                n=pos/sizeof(struct client);
                if(n==p)
                {
                	fread(&d2,sizeof(struct client),1,f2);
                   clrscr();
                   printf("\n nom : %s",d2.c_Nom);
                   printf("\n prenom : %s",d2.c_Prenom);
                   rep=choixon("voulez-vous modifier ce client (o/n) ?",&aut[0],41,5); //ligne PosX, colone PosY
                   if(rep=='o' || rep=='O') //modification du champs -> direct...
                   {
                   	fseek(f2, -1*sizeof(struct client),1);
                      //modifier les champs
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le nom (o/n) ?",&aut[0],38,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_nom(&ch[0],30,&auto_lettre[0],8,8);
                         	strcpy(d2.c_Nom,ch);
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le prenom (o/n) ?",&aut[0],41,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_prenom(&ch[0],30,&auto_lettre[0],11,8);
                         	strcpy(d2.c_Prenom,ch);
                      }
    						clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier la rue (o/n) ?",&aut[0],38,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_rue(&ch[0],30,&auto_lettre[0],8,8);
                         	strcpy(d2.c_Rue,ch);
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le num (o/n) ?",&aut[0],38,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_num(&s,7,&num[0],11,8);
                         	d2.s_Num=s;
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le num de bte (o/n) ?",&aut[0],45,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_numbte(&s,5,&aut[0],12,8);
                         	d2.s_Bte=s;
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le code postale (o/n) ?",&aut[0],47,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_cp(&s,6,&num[0],16,8);
                         	d2.s_CodePost=s;
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier la ville (o/n) ?",&aut[0],40,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_ville(&ch[0],30,&auto_lettre[0],10,8);
                         	strcpy(d2.c_Ville,ch);
                      }
                      clrscr();
                      printf("\n modification du Record no%d :\n\n",n);
                      rep=choixon("voulez-vous modifier le num de telephone (o/n) ?",&aut[0],51,6);
                      if(rep=='o' || rep=='O')
                      {
                      	ajout_tel(&ch2[0],14,&num[0],18,8);
                         	strcpy(d2.c_Tel,ch2);
                      }
                      fwrite(&d2,sizeof(d2),1,f2);
                      //fin modif
                   }
                }
             }
             fclose(f2);
          }
          else
          {
          	printf("\n client inexistant");
          }
       }
       fclose(f1);
       getch();
    }
    /******************************************************************************/
    void suppr_client(char* fichier)
    {
    	char rep;
    	char fichier2[]={"client2.dat"};
    	char aut[]={"oOnN"};
    	int flag=0;
    	struct client d;
    	FILE *f1, *f2;
    	f1=fopen(fichier,"rb");
    	if(f1!=NULL)
    	{
    		f2=fopen(fichier2,"wb");
    		if(f2!=NULL)
    		{
    			fread(&d,sizeof(struct client),1,f1);
    			while(!feof(f1))
    			{
    				//listage du client
                clrscr();
                printf("\n nom : %s",d.c_Nom);
                printf("\n Prenom : %s",d.c_Prenom);
    				rep=choixon("voulez-vous supprimer ce client de la database (o/n) ?",&aut[0],58,4);
    				if(rep=='n'||rep=='N')
    				{
    					flag=1;
    					fwrite(&d,sizeof(d),1,f2);
    				}
             fread(&d,sizeof(struct client),1,f1);
    			}
    		}
    		fclose(f2);
    	}
    	fclose(f1);
    	if(flag==1)
    	{
    		//remove(fichier);
    		//rename(fichier2,fichier);
    	}
       renomfich(fichier2,fichier);
    }
    /******************************************************************************/
    void ajout_client(char* fichier)
    {
    	struct client d;
       char choix;
       char autor2[]={"oOnN"};
       char autor[70]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@_-&|., "};
       char auto_lettre[53]={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."};
       char num[11]={"0123456789."};
       FILE *f;
       //
       char ch[30],ch2[14];
       short s;
       f=fopen(fichier,"a+b");
       if(f!=NULL)
       {
       	do
       	{
    			clrscr();
       		ajout_nom(&ch[0],30,&auto_lettre[0],8,2); //j'envoie ch[30]
             	strcpy(d.c_Nom,ch);
       		ajout_prenom(&ch[0],30,&auto_lettre[0],11,4); //idem
             	strcpy(d.c_Prenom,ch);
       		ajout_rue(&ch[0],30,&auto_lettre[0],8,6);
             	strcpy(d.c_Rue,ch);
       		ajout_num(&s,7,&num[0],11,8);
             	d.s_Num=s;
       		ajout_numbte(&s,5,&autor[0],12,10);
             	d.s_Bte=s;
       		ajout_cp(&s,6,&num[0],16,12);
             	d.s_CodePost=s;
       		ajout_ville(&ch[0],30,&autor[0],10,14);
             	strcpy(d.c_Ville,ch);
       		ajout_tel(&ch2[0],14,&num[0],18,16);
             	strcpy(d.c_Tel,ch2);
     
          	fwrite(&d,sizeof(d),1,f);
     
          	choix=choixon("voulez-vous ajouter un autre client (o/n) ?",&autor2[0],46,18); //ligne PosX, colone PosY
       	}
       	while(choix=='o'||choix=='O');
     
       }
       else
       {
       	printf("\n impossible d'ouvrir le fichier");
       }
       fclose(f);
    }

  10. #10
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    /**partie 3**/

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    /******************************************************************************/
    void aff_auto(struct car* data,int i,int j)
    {
    	//int i=5,j=15;
    	//affichage du tout pour constater la modification
    	gotoxy(i,j-7);cprintf("MARQUE : %s",data->c_Marque);
    	gotoxy(i,j-6);cprintf("MODELE : %s",data->c_Model);
    	gotoxy(i,j-5);cprintf("CHASSIS : %s",data->c_Chassis);
    	gotoxy(i,j-4);cprintf("COULEUR : %s",data->c_Couleur);
    	gotoxy(i,j-3);cprintf("TRANSMISSION : %s",data->c_Transmission);
    	gotoxy(i,j-2);cprintf("ALIMENTE PAR : %s",data->c_Carburant);
    	gotoxy(i,j-1);cprintf("KILOWATTS : %ld",data->s_Kw);
    	gotoxy(i,j);cprintf("CV : %ld",data->s_Cv);
    	gotoxy(i,j+1);cprintf("CC%c : %ld",252,data->s_Cc);
    	gotoxy(i,j+2);cprintf("DATE DE MISE EN CIRCULATION : %s",data->c_Mise_En_Circulation);
    	gotoxy(i,j+3);cprintf("KILOMETRAGE : %s",data->c_KiloMetrage);
    	gotoxy(i,j+4);cprintf("PRIX : %7.2f euros",data->f_Prx);
    	gotoxy(i,j+5);cprintf("PREMIER PROPRIETAIRE : %c",data->c_Prem_Prop);
    	gotoxy(i,j+6);cprintf("CARTE GRISE : %c",data->c_Carte_Grise);
    	gotoxy(i,j+7);cprintf("CARTE DE CONFORMITE : %c",data->c_Carte_Conform);
    	gotoxy(i,j+8);cprintf("CONTROLE TECHNIQUE : %c",data->c_Contr_tech);
    	gotoxy(i,j+9);cprintf("CARNET DU CONSTRUCTEUR : %c",data->c_Carnet_Constructeur);
    	gotoxy(i,j+10);cprintf("BOITE DE SECOURS : %c",data->c_Bte_Secu);
    	gotoxy(i,j+11);cprintf("ROUE DE SECOURS : %c",data->c_Roue_Sec);
    	gotoxy(i,j+12);cprintf("TRIANGLE DE SECOURS : %c",data->c_Triang);
    	gotoxy(i,j+13);cprintf("CARNET CAR PASS : %c",data->c_Car_Pass);
    	gotoxy(i,j+14);cprintf("DECLARE CONFORME POUR CONDUCTEUR HANDICAPE : %c",data->c_Conform_handi);
    	gotoxy(i,j+15);cprintf("AIRBAG : %c",data->c_Air_Bag);
    	gotoxy(i,j+16);cprintf("CLIMATISATION : %c",data->c_Clim);
    	gotoxy(i,j+17);cprintf("NB : %s",data->c_Note);
    	//fin constat
    }
    /******************************************************************************/
    void visualiser(char* index, int y)
    {
    	struct index_car d;
       char fichier[]={"auto.dat"};
       int x=9,i=0,rslt,pos;
       char rep;
       char num[]={"0123456789q"};
    	FILE *f1;
    	f1=fopen(index,"rb");
    	if(f1!=NULL)
    	{
    		fread(&d,sizeof(struct index_car),1,f1);
    		entete_parc_auto();
    		while(!feof(f1))
    		{
     
    			//affichage des champs
    			gotoxy(x-1,y);cprintf("%2d",d.s_No);
    			gotoxy(x+3,y);cprintf("%s",d.c_Marque);
    			gotoxy(x+19,y);cprintf("%s",d.c_Model);
    			gotoxy(x+37,y);cprintf("%s",d.c_Chassis);
    			gotoxy(x+47,y);cprintf("%s",d.c_Carburant);
    			gotoxy(x+61,y);cprintf("%-8.0f",d.f_Prx);
             fread(&d,sizeof(struct index_car),1,f1);
             //affichage des elements du tab
    			gotoxy(x-4,y);cprintf("%c",186);
    			gotoxy(x+2,y);cprintf("%c",186);
    			gotoxy(x+18,y);cprintf("%c",186);
    			gotoxy(x+36,y);cprintf("%c",186);
    			gotoxy(x+46,y);cprintf("%c",186);
    			gotoxy(x+58,y);cprintf("%c",186);
    			gotoxy(x+66,y);cprintf("%c",186);
             y++;
             i++;
    			fread(&d,sizeof(struct index_car),1,f1);
    		}
    		if(i==0)
    		{
     
    			clrscr();
             ecran();
    			gotoxy(10,45);
    			cprintf("veuillez avoir au moins une auto dans la database");
    		}
          else
          {
    			pied_parc_auto(y);
    			gotoxy(10,y+2);cprintf("%d vehicule(s) dans le garage",i);
             gotoxy(6,y+5);rep=choixon("choix du vehicule : ",&num[0],27,y+5);
             if(rep=='q')
             {//on desire quitter search
             }
             else
             {//on a choisi un vehicule
    	         pos=atoi(&rep);
                rslt=0;
             	rslt=aff_det(pos);
                if(rslt)
                {
                	//on a choisi d'acheter le vehicule
                   /*
                   	1. fusion pour retirer le vehicule du fichier
                      2. renommer le fichier fusionné
                      3. recréer l index
                      4. incrementer la structure equipe
                      5. creation de la facture
                   */
                   fus_auto(pos,fichier);
                   creation_index_auto(&fichier[0],&index[0]);
                   //reste a faire le pt 4 et 5
                }
             }
          }
    	}
    	else
    	{
    		gotoxy(10,45);cprintf("veuillez avoir au moins une auto dans la database");
    	}
       return y;
    }
    void fus_auto(int pos,char* fichier)
    {
    	struct car d;
       int i=0;
       FILE *f1,*f2;
       char fichier2[]={"auto2.dat"};
       f1=fopen(fichier,"rb");
       f2=fopen(fichier2,"wb");
       if(f1!=NULL || f2!=NULL)
       {
          fread(&d,sizeof(struct car),1,f1);
          while(!feof(f1))
          {
          	if(i!=pos)
          	{
          		fwrite(&d,sizeof(d),1,f2);
          	}
             i++;
             fread(&d,sizeof(struct car),1,f1);
          }
    		fclose(f1);fclose(f2); //je le met ici car si le f1 est null il sera pas créer et peu importe pour f2
          renomfich(fichier2,fichier);
       }
    }
    int aff_det(int pos)
    {
    	struct car data;
    	FILE *f;
       int n=0;
       int i=15;
       int j;
       f=fopen("auto.dat","rb");
       clrscr();
       ecran();
       if(f!=NULL)
       {
       	fread(&data,sizeof(struct car),1,f);
          while(!feof(f))
          {
          	if(n==pos)
             {
             	gotoxy(4,i-11);cprintf("FICHE DETAILS DU VEHICULE ");//(no de dossier %s",d.c_Dos);
                gotoxy(2,i-9);cprintf("%c",204);
                for(j=3;j<79;j++)
                {
                	gotoxy(j,i-9);cprintf("%c",205);
                }
                gotoxy(j,i-9);cprintf("%c",185);
             	gotoxy(5,i-7);cprintf("MARQUE : %s",data.c_Marque);
             	gotoxy(5,i-6);cprintf("MODELE : %s",data.c_Model);
             	gotoxy(5,i-5);cprintf("CHASSIS : %s",data.c_Chassis);
             	gotoxy(5,i-4);cprintf("COULEUR : %s",data.c_Couleur);
             	gotoxy(5,i-3);cprintf("TRANSMISSION : %s",data.c_Transmission);
             	gotoxy(5,i-2);cprintf("ALIMENTE PAR : %s",data.c_Carburant);
             	gotoxy(5,i-1);cprintf("KILOWATTS : %ld",data.s_Kw);
             	gotoxy(5,i);cprintf("CV : %ld",data.s_Cv);
             	gotoxy(5,i+1);cprintf("CC%c : %ld",252,data.s_Cc);
             	gotoxy(5,i+2);cprintf("DATE DE MISE EN CIRCULATION : %s",data.c_Mise_En_Circulation);
             	gotoxy(5,i+3);cprintf("KILOMETRAGE : %s",data.c_KiloMetrage);
                gotoxy(5,i+4);cprintf("PRIX : %7.2f euros",data.f_Prx);
             	gotoxy(5,i+5);cprintf("PREMIER PROPRIETAIRE : %c",data.c_Prem_Prop);
             	gotoxy(5,i+6);cprintf("CARTE GRISE : %c",data.c_Carte_Grise);
             	gotoxy(5,i+7);cprintf("CARTE DE CONFORMITE : %c",data.c_Carte_Conform);
             	gotoxy(5,i+8);cprintf("CONTROLE TECHNIQUE : %c",data.c_Contr_tech);
             	gotoxy(5,i+9);cprintf("CARNET DU CONSTRUCTEUR : %c",data.c_Carnet_Constructeur);
             	gotoxy(5,i+10);cprintf("BOITE DE SECOURS : %c",data.c_Bte_Secu);
             	gotoxy(5,i+11);cprintf("ROUE DE SECOURS : %c",data.c_Roue_Sec);
             	gotoxy(5,i+12);cprintf("TRIANGLE DE SECOURS : %c",data.c_Triang);
             	gotoxy(5,i+13);cprintf("CARNET CAR PASS : %c",data.c_Car_Pass);
             	gotoxy(5,i+14);cprintf("DECLARE CONFORME POUR CONDUCTEUR HANDICAPE : %c",data.c_Conform_handi);
             	gotoxy(5,i+15);cprintf("AIRBAG : %c",data.c_Air_Bag);
             	gotoxy(5,i+16);cprintf("CLIMATISATION : %c",data.c_Clim);
             	gotoxy(5,i+17);cprintf("NB : %s",data.c_Note);
             	//afficher un bouton quitter ou suivant si achat et le num de dossier
     
             }
             n++;
          	fread(&data,sizeof(struct car),1,f);
          }
       }
       fclose(f);
       return 0; //renverra 1 si on n'achete le vehicule et 0 si pas !
    }
     
    /****************************************************/
    void creation_index_auto(char* fichier, char* index)
    {
    	int j,x;
    	struct car d;
       struct index_car *dyn=NULL;
       int i=0, flag=0;
    	FILE *f1, *f2;
     
       f1=fopen(fichier,"rb");
       if(f1!=NULL)
       {
       	fread(&d, sizeof(struct car), 1, f1);
          while(!feof(f1) && flag==0)
          {
          	dyn=(struct car*)realloc(dyn,(i+1)*sizeof(struct car));
             if(dyn==NULL)
             {
             	flag=1;
                gotoxy(10,10);cprintf("allocation dynamique impossible veuillez quitter les autres applications.");
     
             }
             else
             {
             	dyn[i].s_No=i;
             	strcpy(dyn[i].c_Marque,d.c_Marque);
                strcpy(dyn[i].c_Model,d.c_Model);
                strcpy(dyn[i].c_Chassis,d.c_Chassis);
                strcpy(dyn[i].c_Couleur,d.c_Couleur);
                strcpy(dyn[i].c_Carburant,d.c_Carburant);
                dyn[i].f_Prx=d.f_Prx;
                i++;
             }
             fread(&d, sizeof(struct car), 1, f1);
          }
          f2=fopen(index,"wb");
          if(f2!=NULL)
          {
          	for(j=0;j<i;j++)
             {
             	x=fwrite(&dyn[j],sizeof(struct index_car),1,f2);printf("\n val de fwrite =%d",x);
             }
          }
          fclose(f2);
          for(j=0;j<i;j++)
          {
          	printf("\n%ld => %s",dyn[j].s_No,dyn[j].c_Marque);
          }
       }
       else
       {
       	gotoxy(10,12);cprintf("impossible d'ouvrir le fichier relatif au parc auto veuillez encoder au moins une entree au minimum.");
    	}
       fclose(f1);
    }
    /*****************/
     
    void entete_parc_auto()
    {
    	int i,j,cpt;
    	textmode(C4350);
    	ecran();
    	gotoxy(5,4); cprintf("PARC AUTO");
    	//on com a 4 et on fini a 77 sur x
       //on com a 6
       //gotoxy(6,6);cprintf("*");
       /*Les en-têtes*/
       gotoxy(5,6);cprintf("%c",201); //csg
       for(i=6,j=6;i<75;i++)//ligne verticale
       {
       	gotoxy(i,j);cprintf("%c",205);
     
       }
       gotoxy(5,7);cprintf("%c",186);
       gotoxy(7,7);cprintf("NUM"); //nom de champs
       gotoxy(11,6);cprintf("%c",203);
       gotoxy(11,7);cprintf("%c",186);
       gotoxy(27,6);cprintf("%c",203);
       gotoxy(13,7);cprintf("MARQUE");
       gotoxy(27,7);cprintf("%c",186);
       //gotoxy(27,8);cprintf("%c",202);
       gotoxy(29,7);cprintf("MODEL");
       gotoxy(45,7);cprintf("%c",186);
       //gotoxy(27,8);cprintf("%c",202);
    	gotoxy(45,6);cprintf("%c",203);
       gotoxy(47,7);cprintf("CHASSIS");
       gotoxy(55,7);cprintf("%c",186);
       gotoxy(55,6);cprintf("%c",203);
       gotoxy(57,7);cprintf("CARBURANT");
       gotoxy(67,6);cprintf("%c",203);
       gotoxy(67,7);cprintf("%c",186);
       gotoxy(69,7);cprintf("PRIX");
       gotoxy(75,7);cprintf("%c",186);
       gotoxy(i,j);cprintf("%c",187); //csd
       gotoxy(5,8);cprintf("%c",204); //coude g
       for(i=6,j=8;i<75;i++)//ligne verticale
       {
       	gotoxy(i,j);cprintf("%c",205);
     
       }
       gotoxy(11,8);cprintf("%c",206);
       gotoxy(27,8);cprintf("%c",206);
       gotoxy(45,8);cprintf("%c",206);
       gotoxy(55,8);cprintf("%c",206);
       gotoxy(67,8);cprintf("%c",206);
       gotoxy(i,j);cprintf("%c",185);  //coude droit
       //cadre 1 : marque : 15
       //cadre 2 : model    15
       //cadre 3 : chassis  9
       //cadre 4 : carburant 10	->diesel essence elec lpg+e
       //cadre 5 : prix	10
       //cadre 6 : la touche a pressé 10
    }
    void ecran()
    {
    	int i, j;
       textmode(C4350);
    	textbackground(7);
       clrscr();
     
       gotoxy(5,5);
       textcolor(GREEN);
       //cprintf("C L I E N T S");
       textcolor(RED);
       i=2,j=2;
       gotoxy(i,j);cprintf("%c",201);
       for(i=3,j=2;i<79;i++)  //BARRE HORIZONT SUP
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
       gotoxy(i,j);cprintf("%c",187);
     
       for(i=3,j=49;i<79;i++)//BARRE HORIZONT INF
       {
       	gotoxy(i,j);cprintf("%c",205);
       }
     
       for(i=2,j=3;j<49;j++)   //BARRE VERTI DE G
       {
          gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",200);
       for(i=79,j=3;j<49;j++)                   //BARRE VERTI DE D
       {
          gotoxy(i,j);cprintf("%c",186);
       }
       gotoxy(i,j);cprintf("%c",188);
    }
    void car_search()
    {
    	char index[]={"index_auto.dat"};
    	//affichage de la page pour pouvoir choisir un vehicule on tombera sur une page avec
       //description detaillé et pouvoir revenir a tout moment ou conclure une vente
       ecran();
       entete_parc_auto(); //la position est deja fixé ce n'est pas un paramètre
       visualiser(&index[0],9);
       getch();
    }
    void pied_parc_auto(int y)
    {
    int i=6,j=y,k;
       for(i=6,j=y;i<75;i++)//ligne verticale
       {
       	gotoxy(i,j);cprintf("%c",205);
     
       }
       gotoxy(5,j);cprintf("%c",200);
       gotoxy(11,j);cprintf("%c",202);
       gotoxy(27,j);cprintf("%c",202);
       gotoxy(45,j);cprintf("%c",202);
       gotoxy(55,j);cprintf("%c",202);
       gotoxy(67,j);cprintf("%c",202);
       gotoxy(75,j);cprintf("%c",188);
     
    }

  11. #11
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut f.c ou f.cpp
    donc je met mes fichiers en .c j'ai 100 warning qui me disent ... no prototype et donc j'ai mis en .cpp plus d'erreur et je ne comprend pas pourquoi . donc j'ai remis en .c car ca me semblait logique de garder les f.c mais donc g toujours mes 100 warnings plus des erreurs (8) pourquoi et comment je ne les comprend pas les voilas :

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
     
    Info :Compiling C:\Documents and Settings\Manu\Bureau\test vite fait\car.c
    Warn :  libb.c(225,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(225,16):Conversion may lose significant digits
    Warn :  libb.c(229,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(229,17):Conversion may lose significant digits
    Warn :  libb.c(235,83):Call to function 'choixon' with no prototype
    Warn :  libb.c(235,20):Conversion may lose significant digits
    Warn :  libb.c(238,55):Call to function 'ajout_nom' with no prototype
    Warn :  libb.c(242,86):Call to function 'choixon' with no prototype
    Warn :  libb.c(242,20):Conversion may lose significant digits
    Warn :  libb.c(245,59):Call to function 'ajout_prenom' with no prototype
    Warn :  libb.c(249,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(249,18):Conversion may lose significant digits
    Warn :  libb.c(252,50):Call to function 'ajout_pass' with no prototype
    Warn :  libb.c(258,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(258,18):Conversion may lose significant digits
    Warn :  libb.c(261,49):Call to function 'ajout_rue' with no prototype
    Warn :  libb.c(265,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(265,18):Conversion may lose significant digits
    Warn :  libb.c(268,46):Call to function 'ajout_num' with no prototype
    Warn :  libb.c(273,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(273,18):Conversion may lose significant digits
    Warn :  libb.c(276,51):Call to function 'ajout_numbte' with no prototype
    Warn :  libb.c(280,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(280,18):Conversion may lose significant digits
    Warn :  libb.c(283,45):Call to function 'ajout_cp' with no prototype
    Warn :  libb.c(287,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(287,18):Conversion may lose significant digits
    Warn :  libb.c(290,61):Call to function 'ajout_ville' with no prototype
    Warn :  libb.c(295,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(295,18):Conversion may lose significant digits
    Warn :  libb.c(298,43):Call to function 'ajout_tel' with no prototype
    Warn :  libb.c(302,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(302,18):Conversion may lose significant digits
    Warn :  libb.c(305,54):Call to function 'ajout_mail' with no prototype
    Warn :  libb.c(325,32):Call to function 'renomfich' with no prototype
    Warn :  libb.c(346,44):Call to function 'ajout_nom' with no prototype
    Warn :  libb.c(348,49):Call to function 'ajout_prenom' with no prototype
    Warn :  libb.c(350,40):Call to function 'ajout_pass' with no prototype
    Warn :  libb.c(353,39):Call to function 'ajout_rue' with no prototype
    Warn :  libb.c(355,34):Call to function 'ajout_num' with no prototype
    Warn :  libb.c(357,39):Call to function 'ajout_numbte' with no prototype
    Warn :  libb.c(359,33):Call to function 'ajout_cp' with no prototype
    Warn :  libb.c(361,49):Call to function 'ajout_ville' with no prototype
    Warn :  libb.c(363,39):Call to function 'ajout_tel' with no prototype
    Warn :  libb.c(365,42):Call to function 'ajout_mail' with no prototype
    Warn :  libb.c(370,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(370,11):Conversion may lose significant digits
    Error:  libb.c(379,2):Type mismatch in redeclaration of 'ajout_pass'
    Warn :  libb.c(382,38):Call to function 'saisie' with no prototype
    Error:  libb.c(388,2):Type mismatch in redeclaration of 'ajout_mail'
    Warn :  libb.c(391,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(408,12):Suspicious pointer conversion
    Warn :  libb.c(417,25):Conversion may lose significant digits
    Warn :  libb.c(446,2):'x' is declared but never used
    Error:  libb.c(449,2):Type mismatch in redeclaration of 'renomfich'
    Warn :  libb.c(570,50):Call to function 'ajout_nom' with no prototype
    Warn :  libb.c(572,56):Call to function 'ajout_prenom' with no prototype
    Warn :  libb.c(603,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(603,20):Conversion may lose significant digits
    Warn :  libb.c(610,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(610,23):Conversion may lose significant digits
    Warn :  libb.c(613,60):Call to function 'ajout_nom' with no prototype
    Warn :  libb.c(618,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(618,23):Conversion may lose significant digits
    Warn :  libb.c(621,64):Call to function 'ajout_prenom' with no prototype
    Warn :  libb.c(626,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(626,23):Conversion may lose significant digits
    Warn :  libb.c(629,60):Call to function 'ajout_rue' with no prototype
    Warn :  libb.c(634,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(634,23):Conversion may lose significant digits
    Warn :  libb.c(637,48):Call to function 'ajout_num' with no prototype
    Warn :  libb.c(642,89):Call to function 'choixon' with no prototype
    Warn :  libb.c(642,23):Conversion may lose significant digits
    Warn :  libb.c(645,51):Call to function 'ajout_numbte' with no prototype
    Warn :  libb.c(650,91):Call to function 'choixon' with no prototype
    Warn :  libb.c(650,23):Conversion may lose significant digits
    Warn :  libb.c(653,47):Call to function 'ajout_cp' with no prototype
    Warn :  libb.c(658,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(658,23):Conversion may lose significant digits
    Warn :  libb.c(661,63):Call to function 'ajout_ville' with no prototype
    Warn :  libb.c(666,95):Call to function 'choixon' with no prototype
    Warn :  libb.c(666,23):Conversion may lose significant digits
    Warn :  libb.c(669,54):Call to function 'ajout_tel' with no prototype
    Warn :  libb.c(686,2):Parameter 'index' is never used
    Warn :  libb.c(686,2):Parameter 'fichier' is never used
    Warn :  libb.c(709,87):Call to function 'choixon' with no prototype
    Warn :  libb.c(709,9):Conversion may lose significant digits
    Warn :  libb.c(726,31):Call to function 'renomfich' with no prototype
    Warn :  libb.c(747,46):Call to function 'ajout_nom' with no prototype
    Warn :  libb.c(749,50):Call to function 'ajout_prenom' with no prototype
    Warn :  libb.c(751,46):Call to function 'ajout_rue' with no prototype
    Warn :  libb.c(753,34):Call to function 'ajout_num' with no prototype
    Warn :  libb.c(755,40):Call to function 'ajout_numbte' with no prototype
    Warn :  libb.c(757,34):Call to function 'ajout_cp' with no prototype
    Warn :  libb.c(759,44):Call to function 'ajout_ville' with no prototype
    Warn :  libb.c(761,41):Call to function 'ajout_tel' with no prototype
    Warn :  libb.c(766,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(766,14):Conversion may lose significant digits
    Error:  libb.c(781,2):Type mismatch in redeclaration of 'ajout_nom'
    Warn :  libb.c(784,38):Call to function 'saisie' with no prototype
    Error:  libb.c(790,2):Type mismatch in redeclaration of 'ajout_prenom'
    Warn :  libb.c(793,38):Call to function 'saisie' with no prototype
    Error:  libb.c(799,2):Type mismatch in redeclaration of 'ajout_rue'
    Warn :  libb.c(802,38):Call to function 'saisie' with no prototype
    Error:  libb.c(808,2):Type mismatch in redeclaration of 'ajout_num'
    Warn :  libb.c(813,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(815,6):Nonportable pointer conversion
    Error:  libb.c(815,6):Too many error or warning messages

  12. #12
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par M.a.n.u.
    donc je met mes fichiers en .c j'ai 100 warning qui me
    Il manque la partie 2 de libb.c

  13. #13
    Expert éminent sénior
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Points : 13 380
    Points
    13 380
    Par défaut
    Un truc qui me choque à mort.

    Inclusion de .c c'est carrément horrible il faut jamais faire ça (il y a certaines fois où on peut mais là pas du tout).

    Ensuite tu n'a pas définis tes fonctions dans ton .h (celle qui provoquent une erreur à la compil).

  14. #14
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    donc je compile toujours en c et les fonctions ont leur prototype dans le .h ? (void ecran() soit et donc pour le moment g plus d'erreur g suivi les conseil de Emmanuel d. dans la position de mes fonctions ce qui fait que g toujours mes 100 warning + 1 error qui indique que g trop de warning.

    les voici :

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    Info :Compiling C:\Documents and Settings\Manu\Bureau\test vite fait\test vite fait\car.c
    Warn :  libb.c(194,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(203,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(212,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(223,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(225,6):Nonportable pointer conversion
    Warn :  libb.c(227,2):Parameter 's' is never used
    Warn :  libb.c(225,2):'s' is assigned a value that is never used
    Warn :  libb.c(235,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(237,6):Nonportable pointer conversion
    Warn :  libb.c(239,2):Parameter 's' is never used
    Warn :  libb.c(237,2):'s' is assigned a value that is never used
    Warn :  libb.c(247,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(249,6):Nonportable pointer conversion
    Warn :  libb.c(251,2):Parameter 's' is never used
    Warn :  libb.c(249,2):'s' is assigned a value that is never used
    Warn :  libb.c(258,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(266,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(273,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(282,38):Call to function 'saisie' with no prototype
    Warn :  libb.c(329,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(329,16):Conversion may lose significant digits
    Warn :  libb.c(333,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(333,17):Conversion may lose significant digits
    Warn :  libb.c(339,83):Call to function 'choixon' with no prototype
    Warn :  libb.c(339,20):Conversion may lose significant digits
    Warn :  libb.c(346,86):Call to function 'choixon' with no prototype
    Warn :  libb.c(346,20):Conversion may lose significant digits
    Warn :  libb.c(353,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(353,18):Conversion may lose significant digits
    Warn :  libb.c(362,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(362,18):Conversion may lose significant digits
    Warn :  libb.c(369,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(369,18):Conversion may lose significant digits
    Warn :  libb.c(377,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(377,18):Conversion may lose significant digits
    Warn :  libb.c(384,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(384,18):Conversion may lose significant digits
    Warn :  libb.c(391,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(391,18):Conversion may lose significant digits
    Warn :  libb.c(399,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(399,18):Conversion may lose significant digits
    Warn :  libb.c(406,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(406,18):Conversion may lose significant digits
    Warn :  libb.c(474,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(474,11):Conversion may lose significant digits
    Warn :  libb.c(499,12):Suspicious pointer conversion
    Warn :  libb.c(508,25):Conversion may lose significant digits
    Warn :  libb.c(537,2):'x' is declared but never used
    Warn :  libb.c(689,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(689,20):Conversion may lose significant digits
    Warn :  libb.c(696,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(696,23):Conversion may lose significant digits
    Warn :  libb.c(704,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(704,23):Conversion may lose significant digits
    Warn :  libb.c(712,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(712,23):Conversion may lose significant digits
    Warn :  libb.c(720,82):Call to function 'choixon' with no prototype
    Warn :  libb.c(720,23):Conversion may lose significant digits
    Warn :  libb.c(728,89):Call to function 'choixon' with no prototype
    Warn :  libb.c(728,23):Conversion may lose significant digits
    Warn :  libb.c(736,91):Call to function 'choixon' with no prototype
    Warn :  libb.c(736,23):Conversion may lose significant digits
    Warn :  libb.c(744,84):Call to function 'choixon' with no prototype
    Warn :  libb.c(744,23):Conversion may lose significant digits
    Warn :  libb.c(752,95):Call to function 'choixon' with no prototype
    Warn :  libb.c(752,23):Conversion may lose significant digits
    Warn :  libb.c(772,2):Parameter 'index' is never used
    Warn :  libb.c(772,2):Parameter 'fichier' is never used
    Warn :  libb.c(795,87):Call to function 'choixon' with no prototype
    Warn :  libb.c(795,9):Conversion may lose significant digits
    Warn :  libb.c(852,85):Call to function 'choixon' with no prototype
    Warn :  libb.c(852,14):Conversion may lose significant digits
    Warn :  libb.c(886,15):Call to function 'ecran' with no prototype
    Warn :  libb.c(895,60):Call to function 'ajout_marque_auto' with no prototype
    Warn :  libb.c(896,59):Call to function 'ajout_model_auto' with no prototype
    Warn :  libb.c(897,61):Call to function 'ajout_chassis_auto' with no prototype
    Warn :  libb.c(898,61):Call to function 'ajout_couleur_auto' with no prototype
    Warn :  libb.c(899,67):Call to function 'ajout_transmi_auto' with no prototype
    Warn :  libb.c(900,65):Call to function 'ajout_carbu_auto' with no prototype
    Warn :  libb.c(901,54):Call to function 'ajout_kw_auto' with no prototype
    Warn :  libb.c(902,50):Call to function 'ajout_cv_auto' with no prototype
    Warn :  libb.c(903,50):Call to function 'ajout_cc_auto' with no prototype
    Warn :  libb.c(904,67):Call to function 'ajout_mise_en_circulation_auto' with no prototype
    Warn :  libb.c(905,59):Call to function 'ajout_kilometrage_auto' with no prototype
    Warn :  libb.c(906,51):Call to function 'ajout_prx_auto' with no prototype
    Warn :  libb.c(907,72):Call to function 'choixon' with no prototype
    Warn :  libb.c(907,25):Conversion may lose significant digits
    Warn :  libb.c(909,72):Call to function 'choixon' with no prototype
    Warn :  libb.c(909,25):Conversion may lose significant digits
    Warn :  libb.c(911,80):Call to function 'choixon' with no prototype
    Warn :  libb.c(911,25):Conversion may lose significant digits
    Warn :  libb.c(913,79):Call to function 'choixon' with no prototype
    Warn :  libb.c(913,25):Conversion may lose significant digits
    Warn :  libb.c(915,83):Call to function 'choixon' with no prototype
    Warn :  libb.c(915,25):Conversion may lose significant digits
    Warn :  libb.c(917,77):Call to function 'choixon' with no prototype
    Warn :  libb.c(917,25):Conversion may lose significant digits
    Warn :  libb.c(919,76):Call to function 'choixon' with no prototype
    Warn :  libb.c(919,25):Conversion may lose significant digits
    Warn :  libb.c(921,80):Call to function 'choixon' with no prototype
    Error:  libb.c(921,80):Too many error or warning messages
    et le fichier libb.h ou j'ai mis warning a coté des fonctions qui clocherai

    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
     
    void entete_parc_auto();
    void car_search();
    void equipier();
    void parc_auto();
    void client();
    void menu_principal();
    void Cadre_Deroulant();
    void ecran();  //provoque des warning
    void Cadre_Logo();
    void Logo();
    void modifier_equipier();
    void ajout_equipier();
    void ajout_pass(char*,int,char*,int,int);
    void ajout_mail(char*,int,char*,int,int);
    void creation_index_client(char*,char*);
    void renomfich(char*,char*);
    void trier_index_client(char*);
    void ax_dir_client(char*,char*);
    void suppr_client(char*);
    void ajout_client(char*);
    void ajout_nom(char*,int,char*,int,int);
    void ajout_prenom(char*,int,char*,int,int);
    void ajout_rue(char*,int,char*,int,int);
    void ajout_num(short*,int,char*,int,int);
    void ajout_numbte(short*,int,char*,int,int);
    void ajout_cp(short*,int,char*,int,int);
    void ajout_ville(char*,int,char*,int,int);
    void ajout_tel(char*,int,char*,int,int);
    void ajout_auto(char*);
    void saisie(char*,char*,int,int,int); //provoque un warning !
    void ajout_marque_auto(struct car*,char*,int,int);
    void ajout_model_auto(struct car*,char*,int,int);  //warning
    void ajout_chassis_auto(struct car*,char*,int,int);   //warning !
    void ajout_couleur_auto(struct car*,char*,int,int);  //warning !
    void ajout_transmi_auto(struct car*,char*,int,int);    //war
    void ajout_carbu_auto(struct car*,char*,int,int);       //war
    void ajout_kw_auto(struct car*,char*,int,int);  //war
    void ajout_cv_auto(struct car*,char*,int,int);       //war
    void ajout_cc_auto(struct car*,char*,int,int);            //war
    void ajout_mise_en_circulation_auto(struct car*,char*,int,int); //war
    void ajout_kilometrage_auto(struct car*,char*,int,int);
    void ajout_prx_auto(struct car*,char*,int,int);  //warning
    char choixon(char*,char*,int,int);  //provoque egalement un warning
    void ajout_nb_auto(struct car*,char*,int,int);
    void modif_auto(char*,char*);
    void visualiser(char*,int);
    void creation_index_auto(char*,char*);
    void pied_parc_auto(int);
    int aff_det(int);
    void fus_auto(int,char*);
    void aff_auto(struct car*,int,int);
    merci encore pour votre aide "précieuse"

  15. #15
    Expert éminent sénior

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Points : 17 923
    Points
    17 923
    Billets dans le blog
    2
    Par défaut
    je signale juste que pour déclarer une fonction sans paramètres il faut déclarer void dans les paramètres et non pas vide...

    Exemple :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    void entete_parc_auto(void);
    void car_search(void);
    void equipier(void);
    void parc_auto(void);
    void client(void);
    ...........
    et :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    void Cadre_Deroulant( void)
    {
       int i,j;//cadre pour le menu deroulant principal
       textbackground(7);textcolor(0);
    ....
    sans parler des atrocités notées plus haut.. IL NE FAUT PAS INCLURE UN FICHIER .c DANS UN AUTRE OU DANS UN .h.

    Mais aussi dans tes warnings il y en a un certain nombre que tu pourrais solutionner, en dehors même des déclarations..

    De plus encore 2 remarques :

    1) j'espère (mais j'ai bien peur que si) que ce n'est pas un vrai code industriel.... : aucun commentaire, indentation nulle, fonctions mal ficelées, etc..
    2) si c'est un logiciel industriel, je ne suis pas certain que la boite soit très contente de voir son code ici...

  16. #16
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut
    pour l'info je suis qu'étudiant en 1ere informatique de gestion (bachelier) alors je demanderai un peu de clémence merci pour l'aide

  17. #17
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par M.a.n.u.
    pour l'info je suis qu'étudiant en 1ere informatique de gestion (bachelier) alors je demanderai un peu de clémence merci pour l'aide
    Tu veux sans doute dire 'indulgence' (on en est pas encore à exécuter les posteurs...)

    P.S. Tu n'as toujours pas posté la deuxième partie de libb.c.

  18. #18
    gl
    gl est déconnecté
    Rédacteur

    Homme Profil pro
    Inscrit en
    Juin 2002
    Messages
    2 165
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 165
    Points : 4 637
    Points
    4 637
    Par défaut
    Citation Envoyé par M.a.n.u.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    #include "libb.c"
    Ne cherches pas plus loin, elle est la ton erreur.

    L'inclusion du .c est plus d'etre laide et contraire a toutes les regles de compilation separee (et de bon sens ?) est a l'origine du probleme.

    En effet :
    * libb.c inclus libb.h qui inclus libb.c, etc... Tu as une jolie inclusion recursive (il manque d'ailleurs les garde anti-reinclusion dans tes fichiers d'entete).
    * Malgre cela ton compilateur arrive visiblement a s'en sortir puisqu'il semble compiler quelquechose (soit il gere lui meme les reinclusions soit il a une profondeur d'inclusion limitee), mais tu te retrouves au final avec la definition des fonctions avant le prototype puisque libb.c est inclus dans libb.h avant les prototypes.

    Conclusion, n'inclus plus libb.c dans libb.h et tu n'auras plus ces problemes.

  19. #19
    Membre régulier
    Profil pro
    Étudiant
    Inscrit en
    Avril 2006
    Messages
    110
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2006
    Messages : 110
    Points : 91
    Points
    91
    Par défaut tout est revenu
    ' (on en est pas encore à exécuter les posteurs...)
    sur sinon je serai deja mort donc j'ai reparer ma betise et grand merci a gl, emmanuel delahaye, souviron34 et a Skyrunner. donc maintenant g 35 warning et plus d'erreur

    Mes warnings :

    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
    Info :Compiling C:\Documents and Settings\Manu\Bureau\test vite fait\test vite fait\car.c
    Warn :  LIBB.C(225,6):Nonportable pointer conversion
    Warn :  LIBB.C(227,2):Parameter 's' is never used
    Warn :  LIBB.C(225,2):'s' is assigned a value that is never used
    Warn :  LIBB.C(237,6):Nonportable pointer conversion
    Warn :  LIBB.C(239,2):Parameter 's' is never used
    Warn :  LIBB.C(237,2):'s' is assigned a value that is never used
    Warn :  LIBB.C(249,6):Nonportable pointer conversion
    Warn :  LIBB.C(251,2):Parameter 's' is never used
    Warn :  LIBB.C(249,2):'s' is assigned a value that is never used
    Warn :  LIBB.C(499,12):Suspicious pointer conversion
    Warn :  LIBB.C(508,25):Conversion may lose significant digits
    Warn :  LIBB.C(537,2):'x' is declared but never used
    Warn :  LIBB.C(772,2):Parameter 'index' is never used
    Warn :  LIBB.C(772,2):Parameter 'fichier' is never used
    Warn :  LIBB.C(938,2):'autor3' is assigned a value that is never used
    Warn :  LIBB.C(953,7):Conversion may lose significant digits
    Warn :  LIBB.C(1096,6):Conversion may lose significant digits
    Warn :  LIBB.C(1139,2):'i' is assigned a value that is never used
    Warn :  LIBB.C(1135,2):'j' is assigned a value that is never used
    Warn :  LIBB.C(1705,13):void functions may not return a value
    Warn :  LIBB.C(1682,2):'rslt' is assigned a value that is never used
    Warn :  LIBB.C(1806,12):Suspicious pointer conversion
    Warn :  LIBB.C(1815,23):Conversion may lose significant digits
    Warn :  LIBB.C(1903,2):'cpt' is declared but never used
    Warn :  LIBB.C(1965,2):'k' is declared but never used
    Warn :  LIBB.C(1951,2):'j' is assigned a value that is never used
    Warn :  LIBB.C(1951,2):'i' is assigned a value that is never used
    Warn :  LIBB.C(9,2):Cannot create pre-compiled header: code in header
    Warn :  car.c(29,46):Call to function 'deroulant' with no prototype
    Warn :  car.c(79,45):Call to function 'deroulant' with no prototype
    Warn :  car.c(120,45):Call to function 'deroulant' with no prototype
    Warn :  car.c(109,2):'rslt' is assigned a value that is never used
    Warn :  car.c(160,45):Call to function 'deroulant' with no prototype
    Warn :  car.c(174,2):'fichier' is assigned a value that is never used
    Warn :  car.c(151,2):'rslt' is assigned a value that is never used
    et je v poster l'ensemble de mes codes en cas de besoin et si qq'1 a un tuto pour éviter les erreurs que je fait encore et bien mon mp est open pour quelconque source

  20. #20
    Membre éprouvé Avatar de zooro
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    921
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2006
    Messages : 921
    Points : 1 260
    Points
    1 260
    Par défaut
    Tous les warnings du genre "Parameter 's' is never used" ou "'cpt' is declared but never used" peuvent être facilement corrigés. Il s'agit de paramètres de fonctions ou de variables qui ne sont pas utilisés, et qui peuvent donc être supprimés (vérifie quand même avant ).
    Les warnings "Call to function 'deroulant' with no prototype" indiquent que ta fonction 'deroulant' est appelée avant d'être déclarée. En général, si c'est une fonction définie dans le même fichier que le warning, il suffit de la déplacer un peu plus haut, ou d'ajouter sa déclaration dans le fichier d'entête (s'il y en a un).

    Ca devrait déjà diviser le nombre de warnings par deux, au moins.

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. [Tomcat][JSP] Erreur de génération /compilation
    Par kedare dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 20/02/2006, 09h21
  2. Réponses: 2
    Dernier message: 11/02/2006, 15h42
  3. Réponses: 6
    Dernier message: 21/11/2005, 13h40
  4. Réponses: 2
    Dernier message: 14/11/2005, 11h07
  5. Erreurs à la compilation
    Par Code source dans le forum GLUT
    Réponses: 11
    Dernier message: 02/05/2004, 19h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo