Skip to content

Instantly share code, notes, and snippets.

@DanielDe
Created February 15, 2013 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielDe/4959045 to your computer and use it in GitHub Desktop.
Save DanielDe/4959045 to your computer and use it in GitHub Desktop.
// create 8 person objects on the heap
Person* a = new Person("A");
Person* b = new Person("B");
Person* c = new Person("C");
Person* d = new Person("D");
Person* e = new Person("E");
Person* f = new Person("F");
Person* g = new Person("G");
Person* h = new Person("H");
// assign crushes
a->set_crush(b);
b->set_crush(a);
c->set_crush(d);
d->set_crush(e);
e->set_crush(c);
f->set_crush(g);
g->set_crush(h);
// add all the Person's to a vector
vector<Person*> persons;
persons.push_back(a);
persons.push_back(b);
persons.push_back(c);
persons.push_back(d);
persons.push_back(e);
persons.push_back(f);
persons.push_back(g);
persons.push_back(h);
// uncomment these lines as you implement the functions
// simple_print(persons);
// matchmaker(persons);
// graph_print(persons);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment