Prefix ++ and postfix ++ are different in C++. In the postfix version, a dummy int parameter is added solely to distinguish it from the prefix version — this parameter is never used. A function parameter with only a type and no name is called a dummy parameter.

class A
{
public:
	A& operator++()// prefix ++ — returns a reference
	{
		data += 1;
		return *this;
	}
	const A operator++(int)// postfix ++ — returns by value
	{
		A old(*this);
		++(*this);	// delegates to prefix ++
		return old;
	}
// as the code shows, prefix ++ is more efficient: no temporary object, no copy constructor call
	int data;
};

ostream& operator<<(ostream& os, A& a) {
	os<<a.data<<endl;
	return os;
}

int main() {
	A a={1};
	cout<<a;//1
	A b=++a;
	cout<<b;//2
	cout<<a;//2
	A c=a++;
	cout<<c;//2
	cout<<a;//3

	return 0;
}