Structure et envoi de pointeur
Bonjour,
Comme l'indique explicitement mon titre, j'ai un petit problème de d'envoi de pointeur sur pointeur a une fonction.
Voici le code :
Code:
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
|
#include <stdlib.h>
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dico.h"
struct _MainWindow
{
char *P_Mot_anglais;
char *P_Mot_francais;
GtkWidget *pWindow;
GtkWidget *pVBox;
GtkWidget *pEntry;
GtkWidget *pButton;
GtkWidget *pLabel;
};
typedef struct _MainWindow MainWindow;
/* Fonction d'ouverture du Traducteur */
void FenetreTraducteur(GtkWidget *widget, gpointer data)
{
/* Variables */
GtkWidget *pTable;
MainWindow *pApp;
pApp = g_malloc(sizeof(MainWindow));
/* Création de la fenêtre */
pApp->pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/* Titre de la fenetre */
gtk_window_set_title(GTK_WINDOW(pApp->pWindow), "TRADUCTEUR");
gtk_window_set_default_size(GTK_WINDOW(pApp->pWindow), 900, 500); // Taille de la fenêtre
/* Creation et insertion de la table 10 lignes 10 colonnes */
pTable=gtk_table_new(10,10,TRUE);
gtk_container_add(GTK_CONTAINER(pApp->pWindow), GTK_WIDGET(pTable));
/* Creation du GtkEntry */
pApp->pEntry = gtk_entry_new();
/* Creation du Bouton */
pApp->pButton = gtk_button_new_with_label("Chercher un mot");
gtk_table_attach_defaults(GTK_TABLE(pTable),pApp->pButton, 4, 6, 6, 7);
gtk_table_attach_defaults(GTK_TABLE(pTable), pApp->pEntry, 2, 4, 3, 4);
piocherMot(pApp->&P_Mot_francais, pApp->&P_Mot_anglais);
printf("%s -> %s\n", pApp->P_Mot_francais, pApp->P_Mot_anglais);
free(pApp->P_Mot_francais); /* on libère la mémoire */
free(pApp->P_Mot_anglais);
/* Affichage et boucle événementielle */
gtk_widget_show_all(pApp->pWindow);
gtk_main();
system("pause");
} |
Plus particulierement, mon probleme ce trouve ici
Code:
1 2 3
|
piocherMot(pApp->&P_Mot_francais, pApp->&P_Mot_anglais); |
Sinon le protoype de ma fonction est ainsi :
Code:
1 2 3
|
void piocherMot(char **P_Mot_francais, char **P_Mot_anglais); |
De plus les messages d'erreurs sont :
Code:
1 2 3 4 5
|
C:\Dev-Cpp\Fenetre\test.c In function `FenetreTraducteur':
61 C:\Dev-Cpp\Fenetre\test.c syntax error before '&' token
C:\Dev-Cpp\Fenetre\Makefile.win [Build Error] [test.o] Error 1 |
Voila, pourriez-vous m'expliquer pourquoi ça ne marche pas?
Merci d'avance.