After reading a tutorial about ncurses i was trying to make a pong like game, after a big struggle with finding something remotley alike kbhit() i found a "home made" version after implementing it i found something wierd.
Code:
for( ;; )
{
loop_count++;
if (kbhit())
{
key = getch();
switch(key)
{
case up:
do stuff
...
}
}
printw("%d", loop_count);
}
this code show the variable loop_count After you press any keys but if you replace it with printf("%d", loop_count);
it work like a charm... why is this and is there a way around it? since printf doesnt seem to work very well with ncurses i would very much like to replace it.