using namespace std;
/*class Menu
{
private:
int a;
public:
Menu(int choix)
{
a=choix;
}
Menu(){}
int getchoix()
{
return a;
}
void AfficheMenu()
{
system("cls");
cout<<"1:----------------Creer un nouveau repertoire--------"<<endl;
cout<<"2:----------------Ajouter un nouveau contact---------"<<endl;
cout<<"3:----------------Supprimer un contact---------------"<<endl;
cout<<"4:----------------Afficher tous les contacts---------"<<endl;
cout<<"5:----------------Afficher tous les contact(avec tri)-"<<endl;
cout<<"6:----------------Afficher tous les amis(avec tri)----"<<endl;
cout<<"7:----------------Rechercher un contact---------------"<<endl;
cout<<"8:----------------Vider le repertoire-----------------"<<endl;
cout<<"0:----------------Quitter-----------------------------"<<endl;
}
};*/
class Contact
{
private:
string nom;
string numero;
Contact::AfficheContact();
cout<<"Date de naissance: "<<datenaissance<<endl;
cout<<"BP: "<<post<<endl;
cout<<"E-mail: "<<mail<<endl;
}
};
class Repertoire
{
private:
Contact *t;
int N;
int n;
public:
Repertoire(){}
Repertoire( int Nmax)
{
t=new Contact[N=Nmax];
n=0;
}
void addContact(Contact a){
if (n<N){
t[n++]=a;
}
}
void afficheRepertoire()
{
for(int i=0; i<n;i++)
t[i].AfficheContact();
}
void AfficheMenu()
{
system("cls");
cout<<"1:----------------Creer un nouveau repertoire--------"<<endl;
cout<<"2:----------------Ajouter un nouveau contact---------"<<endl;
cout<<"3:----------------Supprimer un contact---------------"<<endl;
cout<<"4:----------------Afficher tous les contacts---------"<<endl;
cout<<"5:----------------Afficher tous les contact(avec tri)-"<<endl;
cout<<"6:----------------Afficher tous les amis(avec tri)----"<<endl;
cout<<"7:----------------Rechercher un contact---------------"<<endl;
cout<<"8:----------------Vider le repertoire-----------------"<<endl;
cout<<"0:----------------Quitter-----------------------------"<<endl;
}
} ;
int main()
{
int i;
int N;
string *rep;
Contact a;
Repertoire r;
r.AfficheMenu();
int x;
cout<<"Faite un choix"<<endl;
cin>>x;
if(x==0)
{}
if(x==1)
{
{ string *rep;
cout<<"Donner la taille du répertoire"<<endl;
cin>>N;
/* rep=(string*)malloc(N*sizeof(int));
if(N==NULL)
{
cout<<"Espace insufisant"<<endl;
}
else*/
cout<<"Le repertoire a ete cree avec succes"<<endl;}
//getch();
r.AfficheMenu();
cout<<"Faite un choix"<<endl;