#include <iostream>
#include <vector>
class x {
public:
int var1, var2;
};
int main() {
std::vector<x> teste;
x obj1; //criar o objeto
obj1.var1 = 10;
obj1.var2 = 20;
teste.push_back(obj1); //adicionar ao vetor
std::cout<<teste[0].var1<< " " <<teste[0].var2; //10 20
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKY2xhc3MgeCB7CnB1YmxpYzoKICAgIGludCB2YXIxLCB2YXIyOwp9OwoKaW50IG1haW4oKSB7CglzdGQ6OnZlY3Rvcjx4PiB0ZXN0ZTsKCgl4IG9iajE7IC8vY3JpYXIgbyBvYmpldG8KCW9iajEudmFyMSA9IDEwOwoJb2JqMS52YXIyID0gMjA7Cgl0ZXN0ZS5wdXNoX2JhY2sob2JqMSk7IC8vYWRpY2lvbmFyIGFvIHZldG9yCgkKCXN0ZDo6Y291dDw8dGVzdGVbMF0udmFyMTw8ICIgIiA8PHRlc3RlWzBdLnZhcjI7IC8vMTAgMjAKCXJldHVybiAwOwp9