November 9th, 2012, 12:37 PM
Ncurses programming problem
i'm trying to learn ncurses on linux and i got stuck.
I tried to figure out wat was wrong but scince i dont get anny errors it was hard to debug.
can someone help me?
I'm trying to put an X on te screen and move it aurond withde arrow keys.
int main(int argc, char *argv)
my_win = newwin(LINES, COLS, 0, 0);
int x = 5,y=5;
while(c = getch()!='q')
November 9th, 2012, 02:14 PM
Your while loop, try something like so...
Originally Posted by jorants
while((c = getch())!='q')/*Note the extra ()*/
November 9th, 2012, 02:22 PM
link to example of ncurses.
[/code] are essential for python code and Makefiles!
November 9th, 2012, 02:24 PM
November 9th, 2012, 03:39 PM
One other thing i tuned it a little bit, but somehow it prints "^@X" instead of just "X", any idiea why?
November 10th, 2012, 04:10 PM
Oke, sorry for the extra post, but evrything is fixed, i missed a line where i printed 0 (not '0')