Question: I have the application where user can erase image.

So if user touches some px of the image, alfa of these pixels should become lower.

For instance, if I touched (0,0) pixel of the image one time, (0,0) px opacity should become 0.9. If I touched that px 10 times I shouldn't see image at point (0,0).

What is the best approach to implement that?

Answer: 
Firstly - indexes start from zero, so `mainVector[1]` - is not correct.
Secondly - if you dereference your pointer `mainVector[0]->name` or `(*mainVector[0]).name` will give correct value.
From your code, you should be able to do:

```
cout << mainVector[0]->name << endl;

```