Overload the ++ operator to add 1 to the values stored in an array?
<p>Well the title pretty much says it. I have posted a part of my code, I have no idea how to add 1 to the sides of the triangle (a, b and c)... Any help would be greatly appreciated!</p>

<pre><code>class Triangle
{
public:
    Triangle();
    Triangle(double a, double b, double c);
    ~Triangle();
    double get_side_a() const;
    double get_side_b() const;
    double get_side_c() const;
    Triangle&amp; operator++();
    void operator++(int dummy);
private:
    double* sides;
};

Triangle::Triangle()
{
    sides = new double[3];
    sides[0] = 0;
    sides[1] = 0;
    sides[2] = 0;
} // Constructor

Triangle::Triangle(double a, double b, double c)
{
    sides = new double[3];
    sides[0] = a;
    sides[1] = b;
    sides[2] = c;
} // Constructor with parameters

Triangle::~Triangle()
{
    if(sides)
    {
        delete[] sides;
        sides = 0;
    }
} // Destructor

double Triangle::get_side_a() const
{
    return sides[0];
} // get_side_a

double Triangle::get_side_b() const
{
    return sides[1];
} // get_side_b

double Triangle::get_side_c() const
{
    return sides[2];
} // get_side_c

Triangle&amp; Triangle::operator++()
{
    *this = *this + 1;
    return *this;
} // Oprator ++ (prefix)

void Triangle::operator++(int dummy)
{
    ++(*this);
} // Operator ++ (postfix)

int main()
{
    Triangle tri1, tri2;

    cout &lt;&lt; "Enter side legths for triangle 1:" &lt;&lt; endl;
    cin &gt;&gt; tri1;
    cout &lt;&lt; endl &lt;&lt; "Enter side legths for triangle 2:" &lt;&lt; endl;
    cin &gt;&gt; tri2;

    cout &lt;&lt; endl;
    cout &lt;&lt; tri1 &lt;&lt; endl;
    cout &lt;&lt; tri2 &lt;&lt; endl;

    return 0;
}
</code></pre>

<p>I get a error: no match for 'operator+' in '*(Triangle*)this + 1' in this particular writing of Triangle&amp; Triangle::operator++()...</p>

<p>Edit: It's been known for C++ to fry brains, but it something else having to find out first hand. 10x everyone.</p>
