i am developing a calculator in C using GTK+, the code below activates when the cosine button is clicked. i can read the text from the textview, but don't know how to assign the data in text to a char array. i would be grateful for any assistance.
Code:
static gchar str[] = "";
static num1;
on_BTN_COS_clicked(GtkButton *button,
gpointer user_data)
{
GtkWidget *resultfld;
gchar *text;
resultfld = GTK_ENTRY(lookup_widge(button, "entry1"));
text = gtk_entry_get_text(resultfld);
??????? str == text; /// need to asign data in *text to str[] ?????
num1 = strtod( str, &p);
num1 = cos(num1);
sprintf(str,"%f",num1);
gtk_entry_set_text(resultfld, str);
}