Rather than using threads, GUIs, etc., couldn't I just do the
following:
time_t seconds1, seconds2;
char c;
string essay1;
seconds1 = time (NULL);
do {
if(kbhit()) {
c = getch();
essay1.append(1,c);
cout << c;
}
seconds2 = time (NULL);
} while(seconds2 - seconds1 <= 600); // max time in seconds
I came up with it this morning and it seems to do the job. The
solution is to check the time after every key press.
Any thoughts?
Robin.
--- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]>
wrote:
>
> On 9/4/07, Thomas Hruska <[EMAIL PROTECTED]> wrote:
>
> > In other words, "We really have no idea why we exposed this
extremely
> > dangerous function to user-mode code, but please don't use it."
>
> It reminds me of the man page for gets -- under BUGS it says "Never
use gets".
>
> -- Brett
> ------------------------------------------------------------
> "In the rhythm of music a secret is hidden;
> If I were to divulge it, it would overturn the world."
> -- Jelaleddin Rumi
>