Hey guys,

After helping a friend write a graphical frontend to a 9-letter Target Word 
solver (you know, those pesky things that you get in the Sunday paper, where 
you have a 3x3 grid of letters and you have to use those letters to form 
words....), we've ground things out to this one last bug.

The problem is i cant work out how to fix it.
I'm fairly sure it's not a bug with fltk; i've dug through the internals and it 
all looks a-okay from that end.
Below is the only snippet of code that has anything to do with my 
fltk::TextBuffer.
Could anyone provide any decent suggestions?
(i dont think the problem is with the const-ness of textBufferArray - i've 
tried using both a const_cast<> and a const char* ptr = textBufferArray, and 
neither of these have any effects)


    textBufferArray = (char*)calloc(numValidWords * 10 + 1, sizeof(char));
    for (i = 0; i < numValidWords; i++)
        // print to the text array the new word + a newline
        sprintf(textBufferArray+strlen(textBufferArray), "%s\n", validWords[i]);
    // set the output buffer.
    outputBuffer->text(textBufferArray);
    // free our memory.
    free(textBufferArray);



Cheers for the help
Ben
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to