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
| //---------------------------------------------------------------------------
#pragma hdrstop
#pragma argsused
#include <stdio.h>
#include <conio.h>
#include <string.h>
/* ---------------- Variables globales -------------------------------------*/
enum bool{faux,vrai};
struct identite {
int age;
char prenom[20];
char nom[20];
};
struct contact {
char num[20];
char prenom[20];
char nom[20];
};
//-----------------------------------------------------------------------------
enum bool affichage(struct contact m,struct identite m2) {
enum bool bouboul;
getch();
if (strcmp(m.prenom,m2.prenom)==0)
bouboul=vrai;
return bouboul;
}
//-----------------------------------------------------------------------------
int main()
{
//------------ declarations locales -----------------------------------------
struct contact moi;
struct identite moi2;
enum bool mon;
//------ DEBUT --------------------------------------------------------------
printf( "\n Entrer votre prenom : " );
scanf("%s",&moi2.prenom);
strcpy(moi.prenom,moi.prenom);
printf(" \n entrer votre nom : ");
scanf("%s",&moi2.nom);
strcpy(moi.prenom,moi2.prenom);
mon=affichage(moi,moi2);
printf("\n monbool : %d ",mon);
getch();
return 0;
}
//--------------------------------------------------------------------------- |
Partager