R
Rudra Banerjee
const char *str_atype, *str_at1, *str_at2;
str_at1=gtk_entry_get_text(GTK_ENTRY(e->entry1));
str_at2=gtk_entry_get_text(GTK_ENTRY(e->entry2));
float i=atof(str_at1)-atof(str_at2);
print("%f",i);
This small piece of code snippet is giving me bit trouble. The problem is that if I use atoi, the results are coming fine (ofcourse as integer), but not if I use atof, as shown. For any value, i=0.00...means I assume atof did not worked at all.
why this is so?
gtk_entry_get_text is a gtk+ argument, which gets data as string.
str_at1=gtk_entry_get_text(GTK_ENTRY(e->entry1));
str_at2=gtk_entry_get_text(GTK_ENTRY(e->entry2));
float i=atof(str_at1)-atof(str_at2);
print("%f",i);
This small piece of code snippet is giving me bit trouble. The problem is that if I use atoi, the results are coming fine (ofcourse as integer), but not if I use atof, as shown. For any value, i=0.00...means I assume atof did not worked at all.
why this is so?
gtk_entry_get_text is a gtk+ argument, which gets data as string.