On 9/5/07, remarknibor <[EMAIL PROTECTED]> wrote: > Actually, I'm using Dev-C++.
What are you using to get kbhit() and getch() then? Those are not standard functions in C or C++, but are relics from the conio.h days of the old Borland compilers from the early 90s. I think there is a devpak for Dev-C++ that provides some of the functionality of conio. Is that what you are using? > --- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]> > wrote: > > > > On 9/5/07, remarknibor <[EMAIL PROTECTED]> wrote: > > > 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. > > > > Going by the code you have here, I am guessing you are using Turbo > C++? > > > > -- Brett > > ------------------------------------------------------------ > > "In the rhythm of music a secret is hidden; > > If I were to divulge it, it would overturn the world." > > -- Jelaleddin Rumi > > > > > > > To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. > Yahoo! Groups Links > > > > -- ------------------------------------------------------------ "In the rhythm of music a secret is hidden; If I were to divulge it, it would overturn the world." -- Jelaleddin Rumi
