0 Members and 2 Guests are viewing this topic.
FILE * f = fopen("/documents/miner/mapdata.tns", "r");for(j = 0; j < 10120; j++) fscanf(f, "%d", &map[j]);fclose(f);
show_msgbox_2b("Title", "Text", "Button 1", "Button 2");
char filename[256];show_msg_user_input("Test", "Test this", "Default", &filename);printf("%s", filename);free(filename); return 0;
Plop,I've been encountering some problems with Ndless' UI features. This code :Code: [Select]show_msgbox_2b("Title", "Text", "Button 1", "Button 2");Gives that :And it's basically the same with show_msgbox_3b (displays a dialog box with 3 buttons) ; the labels are "Button 1Button 2Button 3", "Button 2Button 3" and "Button 3".
char button1_16[14]; char button2_16[14];
char button1_16[(strlen(button1) + 1) * 2]; char button2_16[(strlen(button2) + 1) * 2];
char button3_16[14];
char button3_16[(strlen(button3) + 1) * 2];
Also, this code just crashes nspire_emu :Code: [Select]char filename[256];show_msg_user_input("Test", "Test this", "Default", &filename);printf("%s", filename);free(filename); return 0;I think that it's a bug with Ndless ...
int main(){ char *filename; if(show_msg_user_input("A", "B", "C", &filename) != -1) free(filename); return 0;}
Indeed, you don't know its size and putting arbitrary size (here 256) is a bad programming behavior.