no save
Assistance
Achat
News

Forum | programmation
[langage C] projet rep.telephonique, help!!!!
krimo_luv, le lun. 14 mai 2007 à 12:28:08
bonjour

donc voila j ai essayé et voila ce que ca me donne:


dite moi qu'est ce qui faut changer et aussi dite moi ce qu'il faut ajouter pour supprimer un contact ou bien le modifier...MERCI

--------------------------------------------------------------------------------------------


#include <stdio.h>

/* Définition du type de string */
typedef char string[20];

/* Definition du type fiche (ligne) de l'agenda */
typedef struct {
string prenom;
string nom;
string tel; } fiche; // une fiche pèse donc 60 caractères

/* Définition (récursive) du type onglet (liste de cellules) */
typedef struct cellule * onglet;
typedef struct cellule {
fiche * ligne;
onglet suite; } cellule;

/* Définition du type agenda */
typedef onglet agenda[26];

fiche*get_fiche(){
fiche*p=(fiche*)malloc(sizeof(fiche));
int r = scanf("%s %s %s", p->prenom, p->nom, p->tel);
if(r==EOF) { //CTRL-D
free(p);
return(NULL);
}
else return(p);
}

void put_fiche(fiche*f){
printf("%s %s %s", f->prenom, f->nom, f->tel);}
void put_onglet(onglet l){
if(l != NULL){
put_fiche(l->ligne);
put_onglet(l->suite);}
}

void put_agenda(agenda a){
int i;
for(i=0; i<26; i++){
printf("==== %c ====", i+'A');
put_onglet(a[i]);
}
}

int main () {
fiche*get_fiche();
put_onglet(onglet l);
put_agenda(agenda a);
}
PrécédentChar Snipeur
mai 07
Char Snipeur
mai 07
Suivant
REPONSES
Stupeflip
mai 07
krimo_luv
mai 07
Char Snipeur
mai 07
krimo_luv
mai 07
Char Snipeur
mai 07
meriem
juin 07
Version Web
Réalisé par RedShift
no save