Category : C++ Source Code
Archive   : JCOOL01.ZIP
Filename : EX6_4.C

 
Output of file : EX6_4.C contained in archive : JCOOL01.ZIP
//
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//

#include // COOL String class
#include // COOL Vector class

#include

int my_sort (const CoolString& s1, const CoolString& s2) {
return ((s1 >= s2) ? -1 : 1); // Reverse alphabetize
}

int main (void) {
CoolVector v1(5); // Declare CoolVector of CoolStrings
v1.push ("Texas"); // Add "Texas"
v1.push ("Alaska"); // Add "Alaska"
v1.push ("New York"); // Add "New York"
v1.push ("Alabama"); // Add "Alabama"
v1.push ("North Dakota"); // Add "North Dakota"
cout << v1 << "\n"; // Output the CoolVector
v1.sort (my_sort); // Reverse sort the CoolVector
for (v1.reset(); v1.next(); ) // For each element
cout << v1.value() << "\n"; // Output the value
return (0); // Exit with OK status
}


  3 Responses to “Category : C++ Source Code
Archive   : JCOOL01.ZIP
Filename : EX6_4.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/