topical media & game development
professional-program-21-BuddyList-BuddyListTest.c
? /
professional-program-21-BuddyList-BuddyListTest.c
include <BuddyList.h>
include <iostream>
using namespace std;
int main(int argc, char** argv)
{
BuddyList buddies;
buddies.addBuddy("Harry Potter", "Ron Weasley");
buddies.addBuddy("Harry Potter", "Hermione Granger");
buddies.addBuddy("Harry Potter", "Hagrid");
buddies.addBuddy("Harry Potter", "Draco Malfoy");
// That's not right! Remove Draco
buddies.removeBuddy("Harry Potter", "Draco Malfoy");
buddies.addBuddy("Hagrid", "Harry Potter");
buddies.addBuddy("Hagrid", "Ron Weasley");
buddies.addBuddy("Hagrid", "Hermione Granger");
list<string> harryBuds = buddies.getBuddies("Harry Potter");
cout << "Harry's friends: \n";
for (list<string>::const_iterator it = harryBuds.begin();
it != harryBuds.end(); ++it) {
cout << "\t" << *it << endl;
}
return (0);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.