I have a (probably stupid) question about the input buffer.
I want to do something while there is no space pressed. But if nothing is pressed, it should be doing it too.
The problem is that by using getch(), the script will keep waiting for an input of the user.
So I was wondering if there is the possibility to add a character to the input buffer, so the script won't pause at the getch() line.
I have tried all kind of stuff. Here is a shortened version of my code:
char c;
do
{
if(stdin==NULL)
c='d';
else
c=getch();
} while(c!=' ');
But nothing get's me closer to a solution. What should I do?