Here are my 3 files
interface file
#ifndef INTERFACE_H_INCLUDED
#define INTERFACE_H_INCLUDED
#include <time.h>
class timer
{
public:
void start();
void end();
int elapsed();
int subtract();
int add();
int output(unsigned int seconds);
private:
bool running;
int begin;
int finish;
};
#endif // INTERFACE_H_INCLUDED
implementation file
using namespace std;
#include "Interface.h"
#include <time.h>
timer::timer()
{
running=false;
begin=0;
}
void timer::start()
{
if(! running)
{
begin=(unsigned int) clock();
running=true;
}
}
void timer::end()
{
if(running)
{
finish=(unsigned int) clock();
running=false;
}
}
int timer::elapsed()
{
if(running)
{
return((unsigned int) clock()-begin);
}
else
{
return finish-begin;
}
}
int timer::output(unsigned int seconds)
{
return seconds >= elapsed();
}
Test file
#include <iostream>
using namespace std;
#include "Interface.h"
#include <conio.h>
class Test
{
int main()
{
bool quit = false;
char choice;
choice=getch();
timer t;
while(! quit)
{
t.start();
t.end();
cout<<"the time is"<<t.output();
}
}
}
ERROR::::::No matching call for function 'timer::output()