Ok thankyou
So as I was saying
Could anyone describe this code, (I am so lost, i really don't understand), in pseuocode
Code:
#include <iostream>
using namespace std;
class Counter
{
public:
Counter();
Counter(int initialValue);
~Counter(){}
int GetItsVal()const { return itsVal; }
void SetItsVal(int x) {itsVal = x; }
Counter Add(const Counter &);
private:
int itsVal;
};
Counter::Counter():
itsVal(0)
{}
Counter::Counter(int initialValue):
itsVal(initialValue)
{}
Counter Counter::Add(const Counter & rhs)
{
return Counter(itsVal+ rhs.GetItsVal());
}
int main()
{
Counter varOne(2), varTwo(4), varThree;
varThree = varOne.Add(varTwo);
cout << "varThree: " << varThree.GetItsVal() << endl;
cout << "varTwo: " << varTwo.GetItsVal() << endl;
cout << "varThree: " << varThree.GetItsVal() << endl;
return 0;
}
and could someone please give me a definition of exploiting references, and overloading functions
thank you so much.
jay