Hi...

I am writing the overloading operator function (prefix ++) according to my book.. but it doesnt work !!!!!!

But if i write:
void operator++()
{
++x;
}
it works !!!!!
Is the book wrong???

Here is my code according to the book that doesnt work as it should:

#include <iostream>
using namespace std;

class things
{
int x,y,z;

public:
void print()
{

cout<<x<<endl;
cout<<y<<endl;
cout<<z<<endl;
cout<<"*****"<<endl;

}
things():x(0),y(0),z(0){};

thing& operator ++() //******** here *******
{
++x;
return *this;
}


};

int main()
{

things table;

cout<<"*****"<<endl;

table.print();

++table;

table.print();

return 0;
}