Hi,
I have a short question about preloading text files for a user interface.

I have x buttons on screen and for each button there is a description shown on screen, once this button is selected.

For now I am fopen()/fgets()/fclose()ing it on every selection change. When run from floppy this is very slow and noisy.

I thought about preloading it to a buffer, but maybe there is a better way. That's why I am asking here.
My idea now looks something like this:

char *ptrarray[10];

ptr_array[0] = malloc(size_of_textfile);
copy_to(file0, ptr_array[0];
ptr_array[1] = malloc(size_of_textfile);
copy_to(file1, ptr_array[1];

...

Can I still use fgets() on these pointers once the file has been loaded there?


Thanks,

Nils

.





_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to