//************************************************************ // // STringListTest.C // //************************************************************ // // Copyright (C) 1996 // // J. Fritz Barnes // Graduate Student // Computer Science Department // University of California // Davis, CA 95616 // // // Permission is granted to use at your own risk and // distribute this software in source and binary forms // provided the above copyright notice and this paragraph // are preserved on all copies. This software is provided // "as is" with no express or implied warranty. // //************************************************************ #include "STringList.h" int main( void ) { // Create Test Strings STring s1( "Alpha" ); STring s2( "Beta" ); STring s3( "Gamma" ); // Create an initial list STringList sl1; sl1.Append( s1 ); sl1.Append( s2 ); sl1.Append( s3 ); cout << "List sl1: " << endl << sl1 << endl; // Perform assignment and deletion STringList sl2; sl2 = sl1; sl2.Remove( 1 ); cout << "List sl2: " << endl << sl2 << endl; // Insert more values sl2.Insert( 0, "Uno" ); sl2.Insert( 2, "Dos" ); sl2.Replace( 3, "Vier" ); cout << "List sl2: " << endl << sl2 << endl; return 0; }