Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<vector>
- #include<iostream>
- #include<string>
- class SomeObject {
- private:
- std::vector<std::string> squares;
- public:
- SomeObject() {}
- void fill() {
- squares.push_back(std::string("one"));
- squares.push_back(std::string("two"));
- }
- void print() const {
- for (std::string s : squares) {
- std::cout << s << std::endl;
- }
- }
- };
- int main() {
- SomeObject o = SomeObject();
- o.fill();
- o.print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement