Is there a specific reason why some people put a semicolon after the curly closing function bracket?
void foo() {
};
The semicolon must follow the class definition curly closing bracket. It is not required after class member functions definitions inside of the class definition. It is required though after class member functions declarations alone inside of the class definition.
#ifndef FRAME_COUNTER_H
#define FRAME_COUNTER_H
#include
#include
const Uint32 FPS = 60;
const Uint32 DELAY_TIME = 1000.0f / FPS;
class FrameCounter {
public:
FrameCounter();
void setFPS(int FPS) { m_FPS = FPS / (m_frameAccumulator / 1000); }
void start() { m_frameStart = SDL_GetTicks(); }
void run();
void reset() {}
void print() { printf("\nFPS: %5.1f\n", m_FPS); }
private:
int m_frameNumber;
Uint32 m_frameStart;
Uint32 m_frameDuration;
Uint32 m_frameAccumulator;
double m_FPS;
};
#endif