c++ class function to create webcount system

trying to make a system to get, hit, reset, and set. I have to use private and public. the objective is to establish some webcounter to display how many users are visiting a page.

my goal is to have the code run and when it says set, i can type in a number, when i type in hit, i add one to the number, get gives me the number and reset brings the number to zero.

I'm lost o.o can someone help?

this is what i have so far and any help would be appreciated :)





#include<iostream>


class Webcounter{


private:
int number_hits;

public:
int get();
void hit(int hit value )
void set(int value);
void reset(int reset value);
};


void webcounter::set(int value){
number_hits=value;
}
int Webcounter::get(){
int get();
return number_hits;

}


int main(){
Webcouter wc;
//wc.reset();
wc.set(0);
cout << wc.get() << << endl;
cout.set(42);
cout << wc.get() << << endl)

}
Topic archived. No new replies allowed.