check if input is given withing next 3 seconds c++ code example
Example: input time from console C++
friend istream &operator>>( istream &input, Time &right ) //input in hh:mm format
{
input >> right.hour; // input hours
input.ignore(); // skip :
input >>right.min; // input minute part
return input;
}