#include <iostream>
//vectors.h
class Vector2
{
    public:
    Vector2();
    ~Vector2();
    int counter;
    Vector2& operator+=(const Vector2& vec);
};

//vectors.cpp
//#include "vectors.h"

Vector2::Vector2()
{
    counter = 0;
}
Vector2::~Vector2()
{
}

Vector2& Vector2::operator+=(const Vector2& vec)//error: too few parameters
{
    int new_n = counter + vec.counter;
    counter = new_n;
    return *this;//error: this may only be used in a non-static member function.
}

//main.cpp
#include <stdio.h>
//#include "vectors.h"

int main()
{
    Vector2 vector;
    while(true)
    {
        vector += vector;//error: expression must be a modifiable value
        printf("Vector counter: %d\n",vector.counter);
    }
}