Compiling it using
Code:
gcc curses.c -o curses -lcurses
and running from a console, when I click I get random letters written to the screen and nothing to log.txt. You can't use printf() reliably (if at all) inside curses in my experience - curses plays with stdout, so it doesn't work as you would expect it to. Also, you have no way to safely close the programme, so the logfile you open never gets closed or flushed, so the logfile will be empty. A better way to test your script would be to either have a way to exit (pressing a key?) which cleans up the logfile, or to use functions like printw() to display debug information... curses style
However, this is just guessing at what you mean by "when i run it nothing happend.what is the problem with it??"... You haven't told us:
i) How you compiled it (or even what language you used, but we can guess that. Though we shouldn't have to
)
ii) What you expected it to do (I assumed printing the text when you click)
iii) What actually happened