I tried find anything about overload operator ++ for pointer, but without results.
There is my code.
struct Item
{
int amount;
Item(int a){ this->amount = a; };
Item& operator++()
{
this->amount++;
return *this;
};
};
int main()
{
Item *I = new Item(5);
++*I;
return 0;
}
Is there any options that a could write only in main function
++I;
(sorry about my English)
++Ialready does something, it increments the pointer. Like it should.