Quote:
|
Originally Posted by rouge
i think the statement i need is soemthing like this :
DisplayWordGame1();
fflush(stdin);
|
Sorry I didn't see this when I was readign your post, I guess I was more focusing on what you code was doing..
You can't flush stdin with fflush(), it only works on output strams, since stdin is an inuput stream you will need to clear it another way, somethign like this
Code:
int clear_stream(FILE* stream)
{
int input;
while(input = fgetc(stream))
{
if(input == (int)'\n')
{ /* we're at the end of stream */
return 0;
}
/* its garbadge clugging up stream */;
}
/* some error happened reading from stream */
return -1;
}
but be warned the above code hasn't been tested, it was just somethign I came up with.
I'm too tired now, I have to get some sleep, it's almost 3am here, and I need to get up in another 3 hours.. See you all tomorrow.