I am writing a class which consists of member functions activated by True mod operations using lapTime below. I have a member function of my class calling itself and I want the screen to update a menu choice which allows the user to interact with the class. The problem is using cin or get waits for user input which throws off the execution of my functions when the time is right for them to do so.
how can I write code to grab input if it is present in the input stream but ignore the cin (or other appropriate command) until input is actually present?
I have included the public members of the systimer class I am using as a reference. (David Levine, Chris Nevison wrote systimer.h and systimer.cpp)
SysTimer(); // constructor
void start(); // begin timing
void stop(); // stop timing
void reset(); // reset timer to 0; stops watch
bool isRunning()const; // true iff stopwatch is running
double lapTime()const; // number of microseconds since start
double elapsedTime()const; // microseconds between start
double cumulativeTime() const; // returns time since last reset
double granularity() const;