11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 28: Standardizing on the Standard Template Library 367int main(int argc, char* pArgs[]){// input a string of namescout name;if ((name.compare(“x”) == 0) ||(name.compare(“X”) == 0)){break;}names.push_back(name);}// sort the list// (this works since String implements a comparisonoperator)names.sort();// display the sorted list// keep displaying names until the collection is emptycout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!