M
MrNEtBomber
i want to pass a user input from gtk input box to a function ... i made code below but i had segmentation errors ...so after looking it up i discovred that the line -> "g_signal_connect(but,"clicked",G_CALLBACK(encode(tx1,tx2)),NULL);"
doesnt make a sense so can you help me do it .
this is program source =>
......
//gets the first argument(buf)
tx1=gtk_entry_get_text(GTK_ENTRY(entry));
....
//gets the second argument(pass)
tx2=gtk_entry_get_text(GTK_ENTRY(entry));
.....
//signal to callback funtion encode when button clicked
g_signal_connect(but,"clicked",G_CALLBACK(encode(tx1,tx2)),NULL);
....
//convert const char* to char*
char* ret (const char *bd){
char *c = new char[12];
strcpy(c,bd);
return c;
}
//encode function
char encode(const char ebuf[],const char epass[]) {
//this is what i only wrote and still having the error.
char *buf=ret(ebuf);
char *pass=ret(epass);
}
doesnt make a sense so can you help me do it .
this is program source =>
......
//gets the first argument(buf)
tx1=gtk_entry_get_text(GTK_ENTRY(entry));
....
//gets the second argument(pass)
tx2=gtk_entry_get_text(GTK_ENTRY(entry));
.....
//signal to callback funtion encode when button clicked
g_signal_connect(but,"clicked",G_CALLBACK(encode(tx1,tx2)),NULL);
....
//convert const char* to char*
char* ret (const char *bd){
char *c = new char[12];
strcpy(c,bd);
return c;
}
//encode function
char encode(const char ebuf[],const char epass[]) {
//this is what i only wrote and still having the error.
char *buf=ret(ebuf);
char *pass=ret(epass);
}