[ad_1]
Asked
Viewed
19 times
i dont know whats wrong with it i want to add a stopwatch to my game project. i have tried to reslove it many times but i couldnt it keeps on telling me expecting a decleration or a semicolon and that the starttime is not declerd
#include <iostream>
#include <ctime>
class Stopwatch
{
public:
int StopWatch()
{
long startTime = time(0);
}
void start()
{
long startTime = time(0);
}
void stop()
{
long endTime = time(0);
{
long getElapsedTime();
{
return endTime - startTime ;
}
private:
long startTime;
long endTime;
};
blackGunther is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
6
lang-cpp
[ad_2]