problem with char *

Jul 7, 2011 at 3:42pm
I have a problem with char, which is really bugging me. I have:

char * newfile = fl_file_chooser("Save File?", "*.txt", "");

in which, fl_file_choser is a function which returns char*. The functions does its job well, but what happens is only the first letter of the text returned by the function is stored in newfile.

Does anyone know what I am doing wrong? It would be a great help to me.

Thank you
Jul 7, 2011 at 4:40pm
We cannot diagnose without seeing the source code for fl_file_chooser(). At most I can say:

-You are passing a Unicode string instead of an ANSI string.
-Your function is writing a null char at position 1.
Jul 7, 2011 at 5:45pm
how do you know that its only the first character?
Jul 7, 2011 at 7:16pm
Thanks a lot for your care. I'm using FLTK to design an interface, and when I passed the same function to a button instead of a menu, it worked!! So, I think the problem should be from the way I pass the function.

Thanks a lot
Topic archived. No new replies allowed.