Here I wrote some wrong code to tell my problem. I want to create a class object and at the same time, I want it to be pushed back into the vector. As a beginner, I don't know if it's possible. I can't figure out how to do it.
L 16 - The problem is that Tests doesn't know anything about vec and obj1 , so it can't access them.
It makes little or no sense if class Tests would have a vector of Tests object.
You could add obj1 to vec in main.