and you might have to change your timer function (someone verify this).
Code:
//Timer Function
int timer(double t)
{
int kp;
double start=double(clock())/1000,end=double(clock())/1000;
for (double dif=0;dif<=t;dif=end-start){end=double(clock())/1000;}
while (kbhit())
{
kp=getkeypress();
return kp;
break;}
}
clock()'s standard, but getkeypress() isn't. BTW, you don't need a while loop, and your casts were wrong:
Code:
//Timer Function
int timer(double t)
{
int kp;
double start=(double)(clock())/1000,end=(double)(clock())/1000;
for (double dif=0;dif<=t;dif=end-start){end=(double)(clock())/1000;}
if (kbhit())
{
kp=getkeypress();
return kp;
}
return 0;
}