I have a few lines of code and I don't get, why and where the copy constructor is called. Could you explain it to me?

The output is:

> 
> CS10
> 
> 
> CS99
> 
> 
> CC100
> 
> 
> Obj10=Obj100
> 
> 
> D100
> 
> 
> Obj10=Obj99
> 
> 
> D99
> 
> 
> D10
> 
> 
> 

This is my source code:

```
#include <iostream>

using namespace std;

class my
{
    int m;
public:
    my(int i): m(i)
    {
        cout << "CS" << m << endl;
    }
    my(const my& c): m(c.m+1)
    {
        cout << "CC" << m << endl;
    }
    ~my()
    {
        cout << "D" << m << endl;
    }
    my& operator=(const my &c)
    {
        cout << "Obj" << m << "=Obj" << c.m << endl;
        return *this;
    }
};

my f(my* x)
{
    return *x;
}

int main()
{
    my m1(10);
    my m2(99);

    m1 = f(&m2); // creates a new object
    m1 = m2;     // does not create a new object
}

```

Why and where is copy constructor called causing the output CC100 and D100?