Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Created November 19, 2013 21:00
Show Gist options
  • Save thiagopnts/7552489 to your computer and use it in GitHub Desktop.
Save thiagopnts/7552489 to your computer and use it in GitHub Desktop.
#include <vector>
#include <iostream>
#include <string>
class Person
{
public:
Person(std::string const& name): name(name) {}
std::string getName() {
return name;
};
~Person();
private:
std::string name;
};
int main(int argc, const char *argv[])
{
Person *p = new Person("Thiago");
std::vector<Person *> people;
std::cout << p->getName() << std::endl;
people.push_back(p);
std::cout << people.size();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment