Created
November 19, 2013 21:00
-
-
Save thiagopnts/7552489 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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