This was an example of the implementation of select() in Beej's code;
I don't like to copy code, so i tried to write my own code from looking at that, but it didn't work, so i tried copying the code, and that didn't work either, my compiler doesn't recognize any of the "FD" commands. this is all the code, and it was linked to w2_32.lib.
** select.c -- a select() demo
#define STDIN 0 // file descriptor for standard input
struct timeval tv;
tv.tv_sec = 2;
tv.tv_usec = 500000;
// don't care about writefds and exceptfds:
select(STDIN+1, &readfds, NULL, NULL, &tv);
if (FD_ISSET(STDIN, &readfds))
printf("A key was pressed!\n");
Edit: because it seems that those FD commands are all over his code, i got discouraged and gave up on his tutorial.