Use ONE of the file-handling routines in C++ or C. Mixing FILE
and ifstream
is certain to cause problems.
ifstream input;
input.open("time.in");
input>> hrs;
input.get();
...
should do the trick.
If you want to be picky:
if (input.get() != ':') ... complain about bad input ...
0
solved How can I double a time value in C++ [closed]