#include <iostream>
using namespace std;
#include "Interface.h"
#include <conio.h>
int main()
{
apple t;
bool quit = false;
while(! quit)
{
cout<<"the original value at beginning of clock is\n"<<clock()<<"\n";
t.start();
cout<<"hit enter when you want to stop timer\n";
if(cin.get()=='\n')
{
t.end();
int time =t.elapsed();
cout<<"the time difference is\n"<<time<<"\n";
cout<<"enter yes if you want to find out time differences for more times\n";
if(cin.get()=='y')
{
cout<<"from yes";
}
else
{
cout<<"from no";
quit=false;
break;
}
}
}
return 0;
}
lotrsimp12345
37
Posting Pro in Training
Recommended Answers
Jump to PostIt already prompts for enter again. I'm going to guess that the problem is with extra stuff being stuck in the stream when you prompt again. You should clear it out. A good way to do that is to use strings and getline so that there isn't ever any extra …
All 4 Replies
lotrsimp12345
37
Posting Pro in Training
Tom Gunn
1,164
Practically a Master Poster
lotrsimp12345
37
Posting Pro in Training
lotrsimp12345
37
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.