Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <map>
- #include <string>
- #include <vector>
- class my_class
- {
- public:
- string str;
- my_class (const std::string& s) : str (s) {}
- };
- int main(int argc, char** argv)
- {
- std::map<string,int> my_map;
- std::vector<my_class> my_vector;
- my_map["abc"] = 23;
- my_map["def"] = 42;
- my_vector.push_back (my_class ("foo"));
- my_vector.push_back (my_class ("bar"));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement