Bonjour,
Je rencontre un problème au niveau des chaines de caractère en GTK+, j'ai ma méthode
Etudiant *ajouterEtudiant_Debut(Etudiant *tete,int id,char n[10],float moy,char app[20])
et j'essaye de réaliser une interface graphique avec des gtkentry, leur valeurs sont récupérables dans des gchar*, or je travaille avec des char[], et du coup ça ne marche pas.
je ne sais pas trop dans quel sens avancer.(Je suis débutante en GTK+)
Voici le code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
/* Recuperation du texte contenu dans les GtkEntry */
const gchar *tid;
gint tid_c;
tid = gtk_entry_get_text(GTK_ENTRY(fen->pid));
tid_c = g_ascii_strtoll (tid,NULL,10);
const gchar *tnom;
tnom = gtk_entry_get_text(GTK_ENTRY(fen->pnom));
const gchar *tmoy;
tmoy = gtk_entry_get_text(GTK_ENTRY(fen->pmoy));
gfloat tmoy_c;
tmoy_c = g_strtod (tmoy, NULL);
const gchar *tappr;
tappr = gtk_entry_get_text(GTK_ENTRY(fen->pappr));
/*Ajout au debut de la liste chainee*/
tete = ajouterEtudiant_Debut(tete,tid_c,tnom,tmoy_c,tappr);
enregistrerListe(tete); |
Merci d'avance.
Partager